コード例 #1
0
        /// <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);
            }
        }
コード例 #2
0
ファイル: ProcessRunner.cs プロジェクト: pkirk/file-watcher
 /// <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);
     }
 }
コード例 #3
0
 /// <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);
 }