-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathOptionsForm.cs
67 lines (58 loc) · 2.58 KB
/
OptionsForm.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
64
65
66
67
#region License
/*
EventHandler Naming Visual Studio Extension
Copyright (C) 2010 Einar Egilsson
http://einaregilsson.com/better-eventhandler-names-in-visual-studio-2010/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
$Id$
*/
#endregion
using System;
using System.Linq;
using System.Windows.Forms;
using System.Diagnostics;
namespace EinarEgilsson.EventHandlerNaming
{
public partial class OptionsForm : Form
{
public OptionsForm(Options options)
{
InitializeComponent();
_options = options;
cboSiteNameTransform.DataSource = Transform.Values.ToList();
cboEventNameTransform.DataSource = Transform.Values.ToList();
txtPattern.Text = _options.Pattern;
chkOmitSiteNameForOwnEvents.Checked = _options.OmitSiteNameForOwnEvents;
cboEventNameTransform.SelectedItem = _options.EventNameTransform;
cboSiteNameTransform.SelectedItem = _options.SiteNameTransform;
chkUseDelegateInference.Checked = _options.UseDelegateInference;
txtRemovePrefixes.Text = _options.RemovePrefixes;
}
private readonly Options _options;
private void OnOKClick(object sender, EventArgs e)
{
_options.Pattern = txtPattern.Text;
_options.OmitSiteNameForOwnEvents = chkOmitSiteNameForOwnEvents.Checked;
_options.EventNameTransform = (Transform)cboEventNameTransform.SelectedItem;
_options.SiteNameTransform = (Transform)cboSiteNameTransform.SelectedItem;
_options.UseDelegateInference = chkUseDelegateInference.Checked;
_options.RemovePrefixes = txtRemovePrefixes.Text;
_options.Save();
DialogResult = DialogResult.OK;
Close();
}
private void OnLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("http://einaregilsson.com/better-eventhandler-names-in-visual-studio-2010/");
}
}
}