private void LogProcess(ProcessStartedEventArgs eventArgs) { Console.WriteLine("----- Adding Process to Cache -----"); Console.WriteLine($"Process Name: {eventArgs.Name}"); Console.WriteLine($"Process ID: {eventArgs.ProcessId}"); Console.WriteLine($"M.W. Handle: {eventArgs.MainWindowHandle}"); Console.WriteLine($"Handle: {eventArgs.Handle}"); }
public void SetUp() { processStartedEventArgs = CreateProcessStartedEventArgs(); processListenerMock = Substitute.For <IProcessListener>(); processHandlerMock = Substitute.For <IProcessHandler>(); systemUnderTest = CreateSystemUnderTest(); }
public void SetUp() { eventArgs = CreateProcessStartedEventArgs(); processValidatorMock = Substitute.For <IProcessValidator>(); boxRepositoryMock = Substitute.For <IBoxRepository>(); systemUnderTest = CreateSystemUnderTest(); }
/// <summary> /// Handles the ping module start event. This turns on the run animation /// and run timer and notifies the user that the process has started. /// </summary> /// <param name="sender"> /// The object sending the event call. /// </param> /// <param name="e"> /// The event arguments. /// </param> private void Pm_ProcessStarted(object sender, ProcessStartedEventArgs e) { this.SafeToggleStatusAnim(true); this.SafeUpdateStatus("Running"); this.SafeWriteConsole("Process started with PID: " + e.ProcessID.ToString()); this.SafeToggleToolbarButton(this.toolStripButtonExec, false); this.SafeToggleToolbarButton(this.toolStripButtonCancel, true); this.SafeToggleTimer(true); }
/// <summary> /// Pass this method as the callback delegate when running a process. /// </summary> public void RunCallback(object sender, ProcessStartedEventArgs e) { if (e == null) { throw new ArgumentNullException(nameof(e)); } _output.WriteLine(e.ProcessWorker.CommandWithArgs); _output.WriteLine(string.Empty); e.ProcessWorker.ProcessCompleted += (s2, e2) => _output.WriteLine(e.ProcessWorker.Output); }
/// <summary> /// Pass this method as the callback delegate when running a process. /// </summary> public void RunCallback(object sender, ProcessStartedEventArgs e) { output.WriteLine(e.ProcessWorker.CommandWithArgs); output.WriteLine(""); e.ProcessWorker.ProcessCompleted += (s2, e2) => output.WriteLine(e.ProcessWorker.Output); }
private void OnProcessStarted(ProcessStartedEventArgs e) { ProcessStarted?.Invoke(this, e); }
private void HandleProcess(object sender, ProcessStartedEventArgs eventArgs) { processHandler.HandleProcess(eventArgs); }
private void LogProcessStart(object sender, ProcessStartedEventArgs e) { Console.WriteLine($"Processor: {((Processor)sender).Id} started process at: {e.Start}\n"); _processLogs.Add(new ProcessLog((Processor)sender, e)); }
/// <summary> /// 当toolKit.Executer中的核心进程启动时调用 /// </summary> /// <param name="e"></param> protected virtual void OnProcessStarted(ProcessStartedEventArgs e) { Logger.Info(this, "Process Started,Pid is " + e.Pid.ToString()); _pid = e.Pid; ProcessStarted?.Invoke(this, e); }
public void CanConstruct() { var args = new ProcessStartedEventArgs(20); Assert.True(args.ProcessID == 20); }
protected virtual void OnProcessStarted(ProcessStartedEventArgs e) => e.Raise(this, ref ProcessStarted);
public void AddBoxToCache(ProcessStartedEventArgs eventArgs) { LogProcess(eventArgs); windowBoxCache.Add(new WindowBox(eventArgs.MainWindowHandle, eventArgs.Handle, eventArgs.ProcessId)); }