-
Notifications
You must be signed in to change notification settings - Fork 4
/
GoToDialog.cs
53 lines (40 loc) · 967 Bytes
/
GoToDialog.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
namespace Menees.Diffs.Windows.Forms
{
#region Using Directives
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Menees.Windows.Forms;
#endregion
internal sealed partial class GoToDialog : ExtendedForm
{
#region Constructors
public GoToDialog()
{
this.InitializeComponent();
}
#endregion
#region Public Methods
public bool Execute(IWin32Window owner, int maxLineNumber, out int line)
{
line = 0;
bool result = false;
this.lblLineNumber.Text = string.Format("&Line Number (1-{0}):", maxLineNumber);
this.edtLineNumber.Maximum = maxLineNumber;
if (this.ShowDialog(owner) == DialogResult.OK)
{
line = (int)this.edtLineNumber.Value;
result = true;
}
return result;
}
#endregion
#region Private Event Handlers
private void GoToDialog_Shown(object sender, EventArgs e)
{
this.edtLineNumber.Select(0, int.MaxValue);
}
#endregion
}
}