Ejemplo n.º 1
0
        //public static void CreateWizard(WizardContainerCmdletBase cmdlet)
        public static void CreateWizard(NewUIAWizardCommand cmdlet)
        {
            if (!cmdlet.ValidateWizardName(cmdlet.Name)) {

                cmdlet.WriteVerbose(
                    cmdlet,
                    "The wizard name you selected is already in use");

                cmdlet.WriteError(
                    cmdlet,
                    "The wizard name you selected is already in use",
                    "NameInUse",
                    ErrorCategory.InvalidArgument,
                    true);
                // return;
            }

            cmdlet.WriteVerbose(cmdlet, "wizard name validated");
            Wizard wzd = new Wizard(cmdlet.Name);
            cmdlet.WriteVerbose(cmdlet, "wizard object created");
            wzd.StartAction = cmdlet.StartAction;
            wzd.StopAction = cmdlet.StopAction;
            wzd.DefaultStepForwardAction = cmdlet.DefaultStepForwardAction;
            wzd.DefaultStepBackwardAction = cmdlet.DefaultStepBackwardAction;
            wzd.DefaultStepCancelAction = cmdlet.DefaultStepCancelAction;
            // 20130319
            //wzd.DefaultStepGetWindowAction = cmdlet.DefaultStepGetWindowAction;
            wzd.GetWindowAction = cmdlet.GetWindowAction;
            cmdlet.WriteVerbose(cmdlet, "the wizard is fulfilled with properties");

            cmdlet.WriteObject(cmdlet, wzd);
        }
Ejemplo n.º 2
0
 public static void CreateWizard(string name, ScriptBlock[] sb)
 {
     UIAutomation.Commands.NewUIAWizardCommand cmdlet =
         new UIAutomation.Commands.NewUIAWizardCommand();
     cmdlet.Name = name;
     cmdlet.StartAction = sb;
     UIANewWizardCommand command =
         new UIANewWizardCommand(cmdlet);
     command.Execute();
 }
Ejemplo n.º 3
0
 public static void CreateWizard(string name, ScriptBlock[] sb)
 {
     Console.WriteLine("CreateWizard 00001");
     UIAutomation.Commands.NewUIAWizardCommand cmdlet =
         new UIAutomation.Commands.NewUIAWizardCommand();
     cmdlet.Name = name;
     Console.WriteLine("CreateWizard 00002");
     // the -StartAction parameter could not be $null
     cmdlet.StartAction = new ScriptBlock[]{ };
     UIANewWizardCommand command =
         new UIANewWizardCommand(cmdlet);
     Console.WriteLine("CreateWizard 00003");
     command.Execute();
     Console.WriteLine("CreateWizard 00004");
 }