示例#1
0
 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}");
 }
示例#2
0
        public void SetUp()
        {
            processStartedEventArgs = CreateProcessStartedEventArgs();

            processListenerMock = Substitute.For <IProcessListener>();
            processHandlerMock  = Substitute.For <IProcessHandler>();
            systemUnderTest     = CreateSystemUnderTest();
        }
示例#3
0
        public void SetUp()
        {
            eventArgs = CreateProcessStartedEventArgs();

            processValidatorMock = Substitute.For <IProcessValidator>();
            boxRepositoryMock    = Substitute.For <IBoxRepository>();
            systemUnderTest      = CreateSystemUnderTest();
        }
示例#4
0
 /// <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);
        }
示例#6
0
 /// <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);
 }
示例#7
0
 private void OnProcessStarted(ProcessStartedEventArgs e)
 {
     ProcessStarted?.Invoke(this, e);
 }
示例#8
0
 private void HandleProcess(object sender, ProcessStartedEventArgs eventArgs)
 {
     processHandler.HandleProcess(eventArgs);
 }
示例#9
0
 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));
 }
示例#10
0
 /// <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);
        }
示例#12
0
 protected virtual void OnProcessStarted(ProcessStartedEventArgs e) => e.Raise(this, ref ProcessStarted);
示例#13
0
 public void AddBoxToCache(ProcessStartedEventArgs eventArgs)
 {
     LogProcess(eventArgs);
     windowBoxCache.Add(new WindowBox(eventArgs.MainWindowHandle, eventArgs.Handle, eventArgs.ProcessId));
 }