-
Notifications
You must be signed in to change notification settings - Fork 20
/
FormCustomToolArgs.cs
63 lines (57 loc) · 1.68 KB
/
FormCustomToolArgs.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
54
55
56
57
58
59
60
61
62
63
using System;
using System.Windows.Forms;
namespace GitForce
{
/// <summary>
/// Form to ask user for arguments before running a custom tool.
/// </summary>
public partial class FormCustomToolArgs : Form
{
/// <summary>
/// Constructor that takes:
/// form title string (used to display description of the query)
/// initial argument string
/// flag whether to show or now Browse... button
/// </summary>
public FormCustomToolArgs(string desc, string args, bool isBrowse)
{
InitializeComponent();
ClassWinGeometry.Restore(this);
Text = desc;
btBrowse.Visible = isBrowse;
comboArgs.Text = args;
}
/// <summary>
/// Access a virtual member
/// </summary>
public override sealed string Text
{
get { return base.Text; }
set { base.Text = value; }
}
/// <summary>
/// Form is closing.
/// </summary>
private void FormCustomToolArgsFormClosing(object sender, FormClosingEventArgs e)
{
ClassWinGeometry.Save(this);
}
/// <summary>
/// Return the final argument string
/// </summary>
public string GetArgs()
{
return comboArgs.Text;
}
/// <summary>
/// Add a user-selected file to the arguments
/// </summary>
private void BtBrowseClick(object sender, EventArgs e)
{
if (openFile.ShowDialog() == DialogResult.OK)
{
comboArgs.Text += openFile.FileName;
}
}
}
}