protected internal void RunWizardStartScriptBlocks(WizardCmdletBase cmdlet, Wizard wizard, object[] parameters) { runTwoScriptBlockCollections( null, wizard.StartAction, cmdlet, parameters); }
protected internal void RunWizardStopScriptBlocks(WizardCmdletBase cmdlet, Wizard wizard, object[] parameters, bool hereMustBeStopAction) { if (hereMustBeStopAction && (null == wizard.StopAction || 0 == wizard.StopAction.Length)) { // cmdlet.WriteVerbose(cmdlet, "there is no any StopAction scriptblock"); //throw new Exception("There are no StopAction scriptblocks, define at least one"); cmdlet.WriteError( cmdlet, "There are no StopAction scriptblocks, define at least one", "NoStopActionScriptblocks", ErrorCategory.InvalidArgument, true); } runTwoScriptBlockCollections( null, wizard.StopAction, cmdlet, parameters); }
protected internal void RunWizardStepScriptBlocks( WizardCmdletBase cmdlet, WizardStep wizardStep, WizardStepActions whatToRun, object[] parameters) { switch (whatToRun) { case WizardStepActions.Forward: // cmdlet.WriteVerbose( // cmdlet, // "ForwardAction scriptblocks"); runTwoScriptBlockCollections( wizardStep.Parent.DefaultStepForwardAction, wizardStep.StepForwardAction, cmdlet, parameters); break; case WizardStepActions.Backward: // cmdlet.WriteVerbose( // cmdlet, // "BackwardAction scriptblocks"); runTwoScriptBlockCollections( wizardStep.Parent.DefaultStepBackwardAction, wizardStep.StepBackwardAction, cmdlet, parameters); break; case WizardStepActions.Cancel: // cmdlet.WriteVerbose( // cmdlet, // "CancelAction scriptblocks"); runTwoScriptBlockCollections( wizardStep.Parent.DefaultStepCancelAction, wizardStep.StepCancelAction, cmdlet, parameters); break; // case WizardStepActions.Stop: // cmdlet.WriteVerbose( // cmdlet, // "StopAction scriptblocks"); // // runTwoScriptBlockCollections( // null, // wizardStep.Parent.StopAction, // cmdlet, // parameters); // break; default: throw new Exception("Invalid value for WizardStepActions on running scriptblocks"); } cmdlet.WriteVerbose( cmdlet, "Scriptblocks finished"); }
protected internal void RunWizardStopScriptBlocks(WizardCmdletBase cmdlet, Wizard wizard, object[] parameters, bool hereMustBeStopAction) { if (hereMustBeStopAction && (null == wizard.StopAction || 0 == wizard.StopAction.Length)) // cmdlet.WriteVerbose(cmdlet, "there is no any StopAction scriptblock"); //throw new Exception("There are no StopAction scriptblocks, define at least one"); cmdlet.WriteError( cmdlet, "There are no StopAction scriptblocks, define at least one", "NoStopActionScriptblocks", ErrorCategory.InvalidArgument, true); runTwoScriptBlockCollections( null, wizard.StopAction, cmdlet, parameters); }
protected internal void RunWizardStartScriptBlocks(WizardCmdletBase cmdlet, Wizard wizard, object[] parameters) { runTwoScriptBlockCollections( null, wizard.StartAction, cmdlet, parameters); }
protected internal void RunWizardStepScriptBlocks( WizardCmdletBase cmdlet, WizardStep wizardStep, bool forward) { if (forward) { runTwoScriptBlockCollections( null, wizardStep.StepForwardAction, cmdlet); } else { runTwoScriptBlockCollections( null, wizardStep.StepBackwardAction, cmdlet); } }
protected internal void RunWizardScriptBlocks(WizardCmdletBase cmdlet, Wizard wizard) { runTwoScriptBlockCollections( null, wizard.StartAction, cmdlet); }
protected internal void RunWizardStepScriptBlocks( WizardCmdletBase cmdlet, WizardStep wizardStep, // 20130318 //bool forward) // 20130321 //bool forward, WizardStepActions whatToRun, object[] parameters) { switch (whatToRun) { case WizardStepActions.Forward: cmdlet.WriteVerbose( cmdlet, "ForwardAction scriptblocks"); runTwoScriptBlockCollections( wizardStep.Parent.DefaultStepForwardAction, wizardStep.StepForwardAction, cmdlet, parameters); break; case WizardStepActions.Backward: cmdlet.WriteVerbose( cmdlet, "BackwardAction scriptblocks"); runTwoScriptBlockCollections( wizardStep.Parent.DefaultStepBackwardAction, wizardStep.StepBackwardAction, cmdlet, parameters); break; case WizardStepActions.Cancel: cmdlet.WriteVerbose( cmdlet, "CancelAction scriptblocks"); runTwoScriptBlockCollections( wizardStep.Parent.DefaultStepCancelAction, wizardStep.StepCancelAction, cmdlet, parameters); break; // case WizardStepActions.Stop: // cmdlet.WriteVerbose( // cmdlet, // "StopAction scriptblocks"); // // runTwoScriptBlockCollections( // null, // wizardStep.Parent.StopAction, // cmdlet, // parameters); // break; default: throw new Exception("Invalid value for WizardStepActions"); } // 20130321 #region commented // if (forward) { // // cmdlet.WriteVerbose( // cmdlet, // "ForwardAction scriptblocks"); // // runTwoScriptBlockCollections( // // 20130317 // //null, // wizardStep.Parent.DefaultStepForwardAction, // wizardStep.StepForwardAction, // // 20130318 // //cmdlet); // cmdlet, // parameters); // // } else { // // cmdlet.WriteVerbose( // cmdlet, // "BackwardAction scriptblocks"); // // runTwoScriptBlockCollections( // // 20130317 // //null, // wizardStep.Parent.DefaultStepBackwardAction, // wizardStep.StepBackwardAction, // // 20130318 // //cmdlet); // cmdlet, // parameters); // // } #endregion commented cmdlet.WriteVerbose( cmdlet, "Scriptblocks finished"); }
// 20130318 //protected internal void RunWizardGetWindowScriptBlocks(WizardCmdletBase cmdlet, Wizard wizard) protected internal bool RunWizardGetWindowScriptBlocks(WizardCmdletBase cmdlet, Wizard wizard, object[] parameters) { bool result = false; try { runTwoScriptBlockCollections( null, // 20130319 //wizard.DefaultStepGetWindowAction, wizard.GetWindowAction, // 20130318 //cmdlet); cmdlet, parameters); if (null != CurrentData.CurrentWindow) { result = true; } } catch {} return result; }
// 20130318 //protected internal void RunWizardGetWindowScriptBlocks(WizardCmdletBase cmdlet, Wizard wizard) protected internal bool RunWizardGetWindowScriptBlocks(WizardCmdletBase cmdlet, Wizard wizard, object[] parameters) { bool result = false; // 20130508 // temporary // profiling cmdlet.WriteInfo(cmdlet, "running the GetWindowAction scriptblock"); cmdlet.WriteInfo(cmdlet, "parameters" + parameters); try { runTwoScriptBlockCollections( null, // 20130319 //wizard.DefaultStepGetWindowAction, wizard.GetWindowAction, // 20130318 //cmdlet); cmdlet, parameters); if (null != CurrentData.CurrentWindow) { result = true; } } catch {} // 20130508 // temporary // profiling cmdlet.WriteInfo(cmdlet, "the result of the GetWindowAction scriptblock run is " + result.ToString()); return result; }
protected internal void RunWizardStepScriptBlocks( WizardCmdletBase cmdlet, WizardStep wizardStep, WizardStepActions whatToRun, object[] parameters) { switch (whatToRun) { case WizardStepActions.Forward: // cmdlet.WriteVerbose( // cmdlet, // "ForwardAction scriptblocks"); runTwoScriptBlockCollections( wizardStep.Parent.DefaultStepForwardAction, wizardStep.StepForwardAction, cmdlet, parameters); break; case WizardStepActions.Backward: // cmdlet.WriteVerbose( // cmdlet, // "BackwardAction scriptblocks"); runTwoScriptBlockCollections( wizardStep.Parent.DefaultStepBackwardAction, wizardStep.StepBackwardAction, cmdlet, parameters); break; case WizardStepActions.Cancel: // cmdlet.WriteVerbose( // cmdlet, // "CancelAction scriptblocks"); runTwoScriptBlockCollections( wizardStep.Parent.DefaultStepCancelAction, wizardStep.StepCancelAction, cmdlet, parameters); break; // case WizardStepActions.Stop: // cmdlet.WriteVerbose( // cmdlet, // "StopAction scriptblocks"); // // runTwoScriptBlockCollections( // null, // wizardStep.Parent.StopAction, // cmdlet, // parameters); // break; default: throw new Exception("Invalid value for WizardStepActions on running scriptblocks"); } cmdlet.WriteVerbose( cmdlet, "Scriptblocks finished"); }