Ejemplo n.º 1
0
        public void SetUp()
        {
            this.commandsList = new UndoRedoCommandList();

            this.command1             = new MockCommand();
            this.command1.CommandName = CommandName1;

            this.command2             = new MockCommand();
            this.command2.CommandName = CommandName2;

            this.command3             = new MockCommand();
            this.command3.CommandName = CommandName3;
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            commandsList = new UndoRedoCommandList();

            command1             = new MockCommand();
            command1.CommandName = COMMAND_NAME1;

            command2             = new MockCommand();
            command2.CommandName = COMMAND_NAME2;

            command3             = new MockCommand();
            command3.CommandName = COMMAND_NAME3;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FrmEditEnvVar"/> class.
        /// </summary>
        /// <param name="variableName">Name of the variable.</param>
        /// <param name="variableType">Type of the variable.</param>
        public FrmEditEnvVar(
            string variableName, EnvironmentVariableTarget variableType)
        {
            this.InitializeComponent();
            this.MinimumSize       = new Size(327, 439);
            dgvValuesList.TabIndex = 0;
            this.LoadSettings();
            txtVariableName.CausesValidation = false;
            this.dgvHandler = new DgvHandler(ref dgvValuesList);

            // set default icon
            this.DgvValuesList_UserAddedRow(null, null);

            this.txtVariableName.Text = variableName;

            // remember current name
            this.variableName = variableName;
            this.variableType = variableType;
            this.validator    = new EnvVarValueValidator();

            if (txtVariableName.Text.Length != 0)
            {
                // Check if we are editing variable
                this.LoadEnvironmentVariableValues();
            }

            // Set form title
            this.Text = (txtVariableName.Text.Length != 0
                ? "Edit" : "New") + " "
                        + (this.variableType == EnvironmentVariableTarget.Machine
                ? "System" : "User") + " Variable";

            this.commandsList = new UndoRedoCommandList();
            this.dgvHandler.SetCurrentCell(0);
            this.editVarNameCommand = new EditVarNameCommand(txtVariableName);

            // disable buttons
            this.SetBtnState();
            txtVariableName.CausesValidation = true;
            this.isVarNameChanged            = false;

            // Open/Save File dialogs
            openFileDialog.Filter     = FileFilter;
            openFileDialog.DefaultExt = DefaultFilterExtension;
            saveFileDialog.Filter     = FileFilter;
            saveFileDialog.DefaultExt = DefaultFilterExtension;
        }
        public void SetUp()
        {
            this.commandsList = new UndoRedoCommandList();

            this.command1 = new MockCommand();
            this.command1.CommandName = CommandName1;

            this.command2 = new MockCommand();
            this.command2.CommandName = CommandName2;

            this.command3 = new MockCommand();
            this.command3.CommandName = CommandName3;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FrmEditEnvVar"/> class.
        /// </summary>
        /// <param name="variableName">Name of the variable.</param>
        /// <param name="variableType">Type of the variable.</param>
        public FrmEditEnvVar(
            string variableName, EnvironmentVariableTarget variableType)
        {
            this.InitializeComponent();
            this.MinimumSize = new Size(327, 439);
            dgvValuesList.TabIndex = 0;
            this.LoadSettings();
            txtVariableName.CausesValidation = false;
            this.dgvHandler = new DgvHandler(ref dgvValuesList);

            // set default icon
            this.DgvValuesList_UserAddedRow(null, null);

            this.txtVariableName.Text = variableName;

            // remember current name
            this.variableName = variableName;
            this.variableType = variableType;
            this.validator = new EnvVarValueValidator();

            if (txtVariableName.Text.Length != 0)
            {   
                // Check if we are editing variable
                this.LoadEnvironmentVariableValues();
            }

            // Set form title
            this.Text = (txtVariableName.Text.Length != 0
                ? "Edit" : "New") + " "
                + (this.variableType == EnvironmentVariableTarget.Machine
                ? "System" : "User") + " Variable";

            this.commandsList = new UndoRedoCommandList();
            this.dgvHandler.SetCurrentCell(0);
            this.editVarNameCommand = new EditVarNameCommand(txtVariableName);
            
            // disable buttons
            this.SetBtnState();
            txtVariableName.CausesValidation = true;
            this.isVarNameChanged = false;

            // Open/Save File dialogs
            openFileDialog.Filter = FileFilter;
            openFileDialog.DefaultExt = DefaultFilterExtension;
            saveFileDialog.Filter = FileFilter;
            saveFileDialog.DefaultExt = DefaultFilterExtension;
        }