/// <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);
        }
        /// <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;
        }