📄 optionsdialog.cs
字号:
#region Copyright (c) 2002-2003, James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole, Philip A. Craig/************************************************************************************'' Copyright 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole' Copyright 2000-2002 Philip A. Craig'' This software is provided 'as-is', without any express or implied warranty. In no ' event will the authors be held liable for any damages arising from the use of this ' software.' ' Permission is granted to anyone to use this software for any purpose, including ' commercial applications, and to alter it and redistribute it freely, subject to the ' following restrictions:'' 1. The origin of this software must not be misrepresented; you must not claim that ' you wrote the original software. If you use this software in a product, an ' acknowledgment (see the following) in the product documentation is required.'' Portions Copyright 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole' or Copyright 2000-2002 Philip A. Craig'' 2. Altered source versions must be plainly marked as such, and must not be ' misrepresented as being the original software.'' 3. This notice may not be removed or altered from any source distribution.''***********************************************************************************/#endregionusing System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using NUnit.Util;
using NUnit.UiKit;
namespace NUnit.Gui
{
/// <summary>
/// Summary description for OptionsDialog.
/// </summary>
public class OptionsDialog : System.Windows.Forms.Form
{
private OptionSettings options;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.HelpProvider helpProvider1;
private System.Windows.Forms.CheckBox clearResultsCheckBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox initialDisplayComboBox;
private System.Windows.Forms.CheckBox reloadOnChangeCheckBox;
private System.Windows.Forms.CheckBox reloadOnRunCheckBox;
private System.Windows.Forms.CheckBox visualStudioSupportCheckBox;
private System.Windows.Forms.CheckBox loadLastProjectCheckBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox recentFilesCountTextBox;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.CheckBox labelTestOutputCheckBox;
private System.ComponentModel.IContainer components = null;
public static void EditOptions( )
{
OptionsDialog dialog = new OptionsDialog( UserSettings.Options );
dialog.ShowDialog();
}
public OptionsDialog( OptionSettings options )
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
this.options = options;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(OptionsDialog));
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.helpProvider1 = new System.Windows.Forms.HelpProvider();
this.loadLastProjectCheckBox = new System.Windows.Forms.CheckBox();
this.clearResultsCheckBox = new System.Windows.Forms.CheckBox();
this.reloadOnChangeCheckBox = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.initialDisplayComboBox = new System.Windows.Forms.ComboBox();
this.reloadOnRunCheckBox = new System.Windows.Forms.CheckBox();
this.visualStudioSupportCheckBox = new System.Windows.Forms.CheckBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.recentFilesCountTextBox = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.labelTestOutputCheckBox = new System.Windows.Forms.CheckBox();
this.groupBox4.SuspendLayout();
this.SuspendLayout();
//
// okButton
//
this.okButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.okButton.Location = new System.Drawing.Point(64, 314);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(63, 20);
this.okButton.TabIndex = 15;
this.okButton.Text = "OK";
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.cancelButton.CausesValidation = false;
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(144, 314);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(56, 20);
this.cancelButton.TabIndex = 16;
this.cancelButton.Text = "Cancel";
//
// loadLastProjectCheckBox
//
this.helpProvider1.SetHelpString(this.loadLastProjectCheckBox, "If checked, most recent project is loaded at startup.");
this.loadLastProjectCheckBox.Location = new System.Drawing.Point(27, 55);
this.loadLastProjectCheckBox.Name = "loadLastProjectCheckBox";
this.helpProvider1.SetShowHelp(this.loadLastProjectCheckBox, true);
this.loadLastProjectCheckBox.Size = new System.Drawing.Size(213, 21);
this.loadLastProjectCheckBox.TabIndex = 4;
this.loadLastProjectCheckBox.Text = "Load most recent project at startup.";
//
// clearResultsCheckBox
//
this.helpProvider1.SetHelpString(this.clearResultsCheckBox, "If checked, any prior results are cleared when reloading.");
this.clearResultsCheckBox.Location = new System.Drawing.Point(27, 187);
this.clearResultsCheckBox.Name = "clearResultsCheckBox";
this.helpProvider1.SetShowHelp(this.clearResultsCheckBox, true);
this.clearResultsCheckBox.Size = new System.Drawing.Size(193, 21);
this.clearResultsCheckBox.TabIndex = 10;
this.clearResultsCheckBox.Text = "Clear results when reloading.";
//
// reloadOnChangeCheckBox
//
this.helpProvider1.SetHelpString(this.reloadOnChangeCheckBox, "If checked, the assembly is reloaded whenever it changes. Changes to this setting" +
" do not take effect until the next time an assembly is loaded.");
this.reloadOnChangeCheckBox.Location = new System.Drawing.Point(27, 159);
this.reloadOnChangeCheckBox.Name = "reloadOnChangeCheckBox";
this.helpProvider1.SetShowHelp(this.reloadOnChangeCheckBox, true);
this.reloadOnChangeCheckBox.Size = new System.Drawing.Size(213, 21);
this.reloadOnChangeCheckBox.TabIndex = 9;
this.reloadOnChangeCheckBox.Text = "Reload when test assembly changes";
//
// label1
//
this.helpProvider1.SetHelpString(this.label1, "");
this.label1.Location = new System.Drawing.Point(27, 83);
this.label1.Name = "label1";
this.helpProvider1.SetShowHelp(this.label1, true);
this.label1.Size = new System.Drawing.Size(120, 21);
this.label1.TabIndex = 5;
this.label1.Text = "Initial display on load:";
//
// initialDisplayComboBox
//
this.initialDisplayComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.helpProvider1.SetHelpString(this.initialDisplayComboBox, "Selects the initial display style of the tree when an assembly is loaded");
this.initialDisplayComboBox.Items.AddRange(new object[] {
"Auto",
"Expand",
"Collapse",
"HideTests"});
this.initialDisplayComboBox.Location = new System.Drawing.Point(167, 83);
this.initialDisplayComboBox.Name = "initialDisplayComboBox";
this.helpProvider1.SetShowHelp(this.initialDisplayComboBox, true);
this.initialDisplayComboBox.Size = new System.Drawing.Size(73, 21);
this.initialDisplayComboBox.TabIndex = 6;
//
// reloadOnRunCheckBox
//
this.helpProvider1.SetHelpString(this.reloadOnRunCheckBox, "If checked, the assembly is reloaded before each run.");
this.reloadOnRunCheckBox.Location = new System.Drawing.Point(27, 139);
this.reloadOnRunCheckBox.Name = "reloadOnRunCheckBox";
this.helpProvider1.SetShowHelp(this.reloadOnRunCheckBox, true);
this.reloadOnRunCheckBox.Size = new System.Drawing.Size(220, 20);
this.reloadOnRunCheckBox.TabIndex = 8;
this.reloadOnRunCheckBox.Text = "Reload before each test run";
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -