Beispiel #1
0
 public void HandleProcess(ProcessStartedEventArgs eventArgs)
 {
     LogProcess(eventArgs);
     if (IsValidProcess(eventArgs))
     {
         AddBoxToRepository(eventArgs);
     }
 }
 public bool ValidateProcess(ProcessStartedEventArgs eventArgs)
 {
     // TODO: Consider making Notepad.exe a constant pulled from configuration.
     return(string.Equals(eventArgs.Name, "notepad", StringComparison.InvariantCultureIgnoreCase));
 }
Beispiel #3
0
 private void LogProcess(ProcessStartedEventArgs eventArgs)
 {
     Console.WriteLine(eventArgs.MainWindowHandle);
 }
Beispiel #4
0
 private bool IsValidProcess(ProcessStartedEventArgs eventArgs)
 {
     return(processValidator.ValidateProcess(eventArgs));
 }
Beispiel #5
0
 private void AddBoxToRepository(ProcessStartedEventArgs eventArgs)
 {
     boxRepository.AddBoxToCache(eventArgs);
 }