コード例 #1
0
 private void EditInstruction()
 {
     if (InstructionBaseDialog.ShowDialog(this, this.instruction, this.VariableNames, this.instruction.Application))
     {
         UpdateFromInstruction(instruction);
     }
 }
コード例 #2
0
        /// <summary>
        /// Shows the appropriate edit dialog for each setup instruction.
        /// </summary>
        /// <param name="currentVariables">Currently used variables (for use in textboxes)</param>
        /// <returns>true, if the user did not cancel</returns>
        public static bool ShowDialog(IWin32Window parent, SetupInstruction instruction, string[] currentVariables, ApplicationJob application)
        {
            InstructionBaseDialog dialog = null;

            if (instruction is StartProcessInstruction)
            {
                dialog = new StartProcessInstructionDialog();
            }
            else if (instruction is CopyFileInstruction)
            {
                dialog = new CopyFileInstructionDialog();
            }
            else if (instruction is CustomSetupInstruction)
            {
                dialog = new CustomSetupInstructionDialog();
            }
            else if (instruction is CloseProcessInstruction)
            {
                dialog = new CloseProcessInstructionDialog();
            }

            if (dialog != null)
            {
                dialog.Application      = application;
                dialog.SetupInstruction = instruction;
                dialog.VariableNames    = currentVariables;
                if (dialog.ShowDialog(parent) == DialogResult.OK)
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #3
0
        private void mnuCloseProcess_Click(object sender, EventArgs e)
        {
            CloseProcessInstruction instruction = new CloseProcessInstruction();

            instruction.Application = this.m_ApplicationJob;
            if (InstructionBaseDialog.ShowDialog(this, instruction, this.txtExecuteAfter.VariableNames, this.m_ApplicationJob))
            {
                SetupInstructionListBoxPanel panel = new SetupInstructionListBoxPanel(instruction)
                {
                    VariableNames = this.txtExecuteAfter.VariableNames
                };
                this.instructionsListBox.Panels.Add(panel);
            }
        }