/// <summary> /// Notifies all subscribers when the process completes. Can be used to initiate the start of /// a second process, or check the status of a completed process. /// </summary> /// <param name="returnCode">Return code corresponding to the status of the process when ended.</param> public virtual void RaiseProcessComplete(FireProcessReturnCodes returnCode, string message = "") { if (OnProcessCompleteEvent != null) { ProcessCompletedArgs args = new ProcessCompletedArgs(returnCode, message); OnProcessCompleteEvent(this, args); } }
/// <summary> /// Delegate handler for messages returned from RefreshProcess /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void ProcessController_OnProcessCompleteEvent(object sender, ProcessCompletedArgs e) { if (m_LiveConsoleMode) { Console.WriteLine($"{sender}:: {e.Message}"); // write out to console if open } if (e.ReturnType == FireProcessReturnCodes.SUCCESS) // if previous job was successful, then proceed to next job in queue { StartNextInProcessQueue(); } // ToDo: Add call to Pearson's logging library here }
/// <summary> /// Notifies all subscribers when the process completes. Can be used to initiate the start of /// a second process, or check the status of a completed process. Supports "chaining" events of /// the same type together. /// </summary> /// <param name="sender">Sender invoking the call to the delegate</param> /// <param name="e">ProcessCompletedArgs to pass to event listeners.</param> protected virtual void ProcessCompletedEventHandler(object sender, ProcessCompletedArgs e) { this.OnProcessCompleteEvent(this, e); }