Exemplo n.º 1
0
 public void OnMessageReceived(EventType eventType, PluginInterface.Message message)
 {
     switch (eventType)
     {
         case EventType.ApplicationClosing:
         case EventType.ApplicationStarted:
             break;
             // Here Error property will be null
             // Only Result will be non-null
             MessageBox.Show("I received a injection related message: " + message.Result);
         case EventType.TargetAssemblyLoaded:
         case EventType.InjectionAssemblyLoaded:
             break;
             // Here Error property will be null
             // Only Result will be non-null with injector/target assembly path
             MessageBox.Show("I received a injection related message: " + message.Result);
         case EventType.MethodInjectionStart:
         case EventType.MethodInjectionComplete:
             // Here Error property will be null
             // Expect Target, Injector will be non-null
             MessageBox.Show("I received a injection related message: " + message.ToString());
             break;
         case EventType.ProcessComplete:
         case EventType.ProcessStart:
             // Here Error property will be null
             // Expect only the Result to be non-null
             MessageBox.Show("I received a process related message: " + message.Result);
             break;
         case EventType.Error:
             MessageBox.Show("I received an error message: " + message.Error);
             break;
     }
 }