コード例 #1
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);
        }
コード例 #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
 public SetupInstructionListBoxPanel(SetupInstruction instruction) : this()
 {
     UpdateFromInstruction(instruction);
 }
コード例 #4
0
 private void UpdateFromInstruction(SetupInstruction instruction)
 {
     this.instruction = instruction;
     CommandText = instruction.ToString();
     CommandName = instruction.Name;
 }
コード例 #5
0
 public SetupInstructionListBoxPanel(SetupInstruction instruction) : this()
 {
     UpdateFromInstruction(instruction);
 }
コード例 #6
0
 private void UpdateFromInstruction(SetupInstruction instruction)
 {
     this.instruction = instruction;
     CommandText      = instruction.ToString();
     CommandName      = instruction.Name;
 }