/// <summary> /// Raises process started event. Runs in the main thread. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">Event data.</param> private void RaiseProcessStartedEvent(object sender, ProcessStartedEventArgs e) { EventHandler <ProcessStartedEventArgs> handler = ProcessStarted; if (handler != null) { handler(sender, e); } }
/// <summary> /// Raises process started event. Runs in the main thread. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">Event data.</param> private void RaiseProcessStartedEvent(object sender, ProcessStartedEventArgs e) { EventHandler<ProcessStartedEventArgs> handler = ProcessStarted; if (handler != null) { handler(sender, e); } }
/// <summary> /// Handles process started event. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">Event data.</param> private void OnProcessStarted(object sender, ProcessStartedEventArgs e) { // Run threaded event in main thread. _synchronizationContext.Send(new SendOrPostCallback(delegate { EventHandler<ControllerProcessStartedEventArgs> handler = ProcessStarted; if (handler != null) { ControllerProcessStartedEventArgs controllerProcessStartedEventArgs = new ControllerProcessStartedEventArgs(e.DaemonName, e.ProcessId, e.FileName, e.Arguments, e.Verb, e.ProcessStartTime, e.LogEvent, GetProcessQueueCount()); handler(this, controllerProcessStartedEventArgs); } }), null); }