internal void RunCurrentStepParameters(WizardRunCmdletBase cmdlet, Wizard wizard, WizardStep currentStep, object[] currentParameters) { // 20130606 //cmdlet.WriteVerbose(cmdlet, "running scriptblocks for the '" + currentStep.Name + "' step"); cmdlet.WriteInfo(cmdlet, "running scriptblocks for the '" + currentStep.Name + "' step"); if (WizardStepActions.Stop == currentStep.ToDo) { cmdlet.WriteInfo(cmdlet, "running scriptblocks from the StopAction scriptblock set"); // 20130819 // cmdlet.RunWizardStopScriptBlocks(cmdlet, wizard, currentParameters); cmdlet.RunWizardStopScriptBlocks(cmdlet, wizard, currentParameters, true); // 20130508 // temporary // profiling //cmdlet.WriteVerbose(cmdlet, "StopAction has finished, exiting..."); cmdlet.WriteInfo(cmdlet, "StopAction has finished, exiting..."); return; } else { // 20130508 cmdlet.WriteInfo(cmdlet, "running scriptblocks for step '" + currentStep.Name + "', " + currentStep.ToDo.ToString()); cmdlet.RunWizardStepScriptBlocks(cmdlet, currentStep, currentStep.ToDo, currentParameters); cmdlet.WriteInfo(cmdlet, "Forward, Backward or Cancel scriptblocks have finished"); } }
// 20130329 // running the StopAction script after timeout expired internal bool InterruptOnTimeoutExpiration(WizardRunCmdletBase cmdlet, Wizard wizard) { // 20130712 bool interrupt = false; DateTime nowDate = DateTime.Now; if (!((nowDate - cmdlet.StartDate).TotalSeconds > Preferences.Timeout / 1000)) { return(interrupt); } cmdlet.WriteVerbose( cmdlet, "Timout expired. Running the StopAction scriptblock"); cmdlet.RunWizardStopScriptBlocks(cmdlet, wizard, wizard.StopActionParameters, false); cmdlet.WriteVerbose( cmdlet, "outputting the wizard"); if (Quiet) { cmdlet.WriteObject(cmdlet, false); return(interrupt); } else { cmdlet.WriteError(cmdlet, "Timeout expired", "TimeoutExpired", ErrorCategory.OperationTimeout, true); } interrupt = true; return(interrupt); }
internal void RunCurrentStepParameters(WizardRunCmdletBase cmdlet, Wizard wizard, WizardStep currentStep, object[] currentParameters) { // 20130606 //cmdlet.WriteVerbose(cmdlet, "running scriptblocks for the '" + currentStep.Name + "' step"); cmdlet.WriteInfo(cmdlet, "running scriptblocks for the '" + currentStep.Name + "' step"); if (WizardStepActions.Stop == currentStep.ToDo) { cmdlet.WriteInfo(cmdlet, "running scriptblocks from the StopAction scriptblock set"); // 20130819 // cmdlet.RunWizardStopScriptBlocks(cmdlet, wizard, currentParameters); cmdlet.RunWizardStopScriptBlocks(cmdlet, wizard, currentParameters, true); // 20130508 // temporary // profiling //cmdlet.WriteVerbose(cmdlet, "StopAction has finished, exiting..."); cmdlet.WriteInfo(cmdlet, "StopAction has finished, exiting..."); return; } else { // 20130508 cmdlet.WriteInfo(cmdlet, "running scriptblocks for step '" + currentStep.Name + "', " + currentStep.ToDo.ToString()); cmdlet.RunWizardStepScriptBlocks(cmdlet, currentStep, currentStep.ToDo, currentParameters); cmdlet.WriteInfo(cmdlet, "Forward, Backward or Cancel scriptblocks have finished"); } }
// 20130329 // running the StopAction script after timeout expired internal bool InterruptOnTimeoutExpiration(WizardRunCmdletBase cmdlet, Wizard wizard) { // 20130712 bool interrupt = false; DateTime nowDate = DateTime.Now; if (!((nowDate - cmdlet.StartDate).TotalSeconds > Preferences.Timeout/1000)) return interrupt; cmdlet.WriteVerbose( cmdlet, "Timout expired. Running the StopAction scriptblock"); cmdlet.RunWizardStopScriptBlocks(cmdlet, wizard, wizard.StopActionParameters, false); cmdlet.WriteVerbose( cmdlet, "outputting the wizard"); if (Quiet) { cmdlet.WriteObject(cmdlet, false); return interrupt; } else { cmdlet.WriteError(cmdlet, "Timeout expired", "TimeoutExpired", ErrorCategory.OperationTimeout, true); } interrupt = true; return interrupt; }
// 20130325 // 20130329 // 20130318 //cmdlet.RunWizardStepScriptBlocks(cmdlet, currentStep, cmdlet.ForwardDirection); // 20130321 //cmdlet.ForwardDirection, // 20130321 //cmdlet.ForwardDirection ? currentStep.StepForwardActionParameters : currentStep.StepBackwardActionParameters); internal void RunCurrentStepParameters(WizardRunCmdletBase cmdlet, Wizard wizard, WizardStep currentStep, object[] currentParameters) { if (WizardStepActions.Stop == currentStep.ToDo) { cmdlet.RunWizardStopScriptBlocks(cmdlet, wizard, currentParameters); cmdlet.WriteVerbose(cmdlet, "StopAction has finished, exiting..."); return; } else { cmdlet.RunWizardStepScriptBlocks(cmdlet, currentStep, currentStep.ToDo, currentParameters); } }
// 20130329 // running the StopAction script after timeout expired internal void InterruptOnTimeoutExpiration(WizardRunCmdletBase cmdlet, Wizard wizard) { System.DateTime nowDate = System.DateTime.Now; if ((nowDate - cmdlet.StartDate).TotalSeconds > (Preferences.Timeout / 1000)) { cmdlet.WriteVerbose( cmdlet, "Timout expired. Running the StopAction scriptblock"); cmdlet.RunWizardStopScriptBlocks(cmdlet, wizard, wizard.StopActionParameters); cmdlet.WriteVerbose( cmdlet, "outputting the wizard"); if (this.Quiet) { cmdlet.WriteObject(cmdlet, false); return; } else { cmdlet.WriteError(cmdlet, "Timeout expired", "TimeoutExpired", ErrorCategory.OperationTimeout, true); } } }