1
// ****************************************************************
2
// Copyright 2012, Charlie Poole
3
// This is free software licensed under the NUnit license. You may
4
// obtain a copy of the license at http://nunit.org
5
// ****************************************************************
8
using System.Collections.Generic;
9
using System.ComponentModel;
12
using System.Windows.Forms;
15
namespace NUnit.Gui.SettingsPages
17
public partial class ProjectEditorSettingsPage : SettingsPage
19
private static readonly string EDITOR_PATH_SETTING = "Options.ProjectEditor.EditorPath";
21
public ProjectEditorSettingsPage(string key) : base(key)
23
InitializeComponent();
26
public override void LoadSettings()
28
string editorPath = (string)settings.GetSetting(EDITOR_PATH_SETTING);
30
if (editorPath != null)
32
useOtherEditorRadioButton.Checked = true;
33
editorPathTextBox.Text = editorPath;
37
useNUnitEditorRadioButton.Checked = true;
38
editorPathTextBox.Text = "";
42
public override void ApplySettings()
44
if (useNUnitEditorRadioButton.Checked)
45
settings.RemoveSetting(EDITOR_PATH_SETTING);
47
settings.SaveSetting(EDITOR_PATH_SETTING, editorPathTextBox.Text);
50
private void editorPathTextBox_TextChanged(object sender, EventArgs e)
52
if (editorPathTextBox.TextLength == 0)
53
useNUnitEditorRadioButton.Checked = true;
55
useOtherEditorRadioButton.Checked = true;
58
private void editorPathBrowseButton_Click(object sender, EventArgs e)
60
OpenFileDialog dlg = new OpenFileDialog();
61
if ( Site != null ) dlg.Site = Site;
62
dlg.Title = "Select Project Editor";
64
dlg.Filter = "Executable Files (*.exe)|*.exe";
68
if ( dlg.ShowDialog( this ) == DialogResult.OK )
69
editorPathTextBox.Text = dlg.FileName;
1
// ****************************************************************
2
// Copyright 2012, Charlie Poole
3
// This is free software licensed under the NUnit license. You may
4
// obtain a copy of the license at http://nunit.org
5
// ****************************************************************
8
using System.Collections.Generic;
9
using System.ComponentModel;
12
using System.Windows.Forms;
15
namespace NUnit.Gui.SettingsPages
17
public partial class ProjectEditorSettingsPage : SettingsPage
19
private static readonly string EDITOR_PATH_SETTING = "Options.ProjectEditor.EditorPath";
21
public ProjectEditorSettingsPage(string key) : base(key)
23
InitializeComponent();
26
public override void LoadSettings()
28
string editorPath = (string)settings.GetSetting(EDITOR_PATH_SETTING);
30
if (editorPath != null)
32
useOtherEditorRadioButton.Checked = true;
33
editorPathTextBox.Text = editorPath;
37
useNUnitEditorRadioButton.Checked = true;
38
editorPathTextBox.Text = "";
42
public override void ApplySettings()
44
if (useNUnitEditorRadioButton.Checked)
45
settings.RemoveSetting(EDITOR_PATH_SETTING);
47
settings.SaveSetting(EDITOR_PATH_SETTING, editorPathTextBox.Text);
50
private void editorPathTextBox_TextChanged(object sender, EventArgs e)
52
if (editorPathTextBox.TextLength == 0)
53
useNUnitEditorRadioButton.Checked = true;
55
useOtherEditorRadioButton.Checked = true;
58
private void editorPathBrowseButton_Click(object sender, EventArgs e)
60
OpenFileDialog dlg = new OpenFileDialog();
61
if ( Site != null ) dlg.Site = Site;
62
dlg.Title = "Select Project Editor";
64
dlg.Filter = "Executable Files (*.exe)|*.exe";
68
if ( dlg.ShowDialog( this ) == DialogResult.OK )
69
editorPathTextBox.Text = dlg.FileName;