/// <summary> /// The run. /// </summary> /// <param name="timeoutInMilliseconds"> /// The timeout in milliseconds. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public bool Run(int timeoutInMilliseconds) { // instanciate module var function = new Functions.ApplicationArea.Page_Home.Page_Home_Functions(); var processFunctions = new Functions.Helpers.DeviceCareProcessFunctions(); // close frame function.CloseFrame(); // check if frame is closed // NOTE: IsFrameClosed(int timeOutInMilliseconds) always needs a timeout parameter. If user timeout shall be omitted, set timeout to 0 or -1 (default 30s is used then) if (function.IsFrameClosed(timeoutInMilliseconds)) { // for debugging: // simulates that the process is still running in background // user has to open devicecare again in that time window // Delay.Milliseconds(10000); // check if process is terminated if (function.IsDCProcessTerminated()) { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Closing Host Application was successful"); return(true); } Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The DeviceCare process is still running"); CommonInternal.ProcessInformation.PublishProcessSummary(processFunctions.GetDcProcess()); return(false); } Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Frame was not successfully closed"); return(false); }
/// <summary> /// The run. /// </summary> /// <returns> /// The <see cref="bool"/>. /// </returns> public bool Run() { var module = new Functions.Helpers.DeviceCareProcessFunctions(); Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Current task: Open HostApplication (DeviceCare)"); return(module.Run()); }
/// <summary> /// The run. /// </summary> /// <param name="path"> /// The path. /// </param> /// <param name="timeOutInMilliseconds"> /// The time out in milliseconds. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public bool Run(string path, int timeOutInMilliseconds) { var module = new Functions.Helpers.DeviceCareProcessFunctions(); Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Current task: Open HostApplication (DeviceCare)"); int processId = module.Run(path, timeOutInMilliseconds); return(module.IsHostApplicationRunning(processId)); }