public void DoCallback(PluginEventArgs e)
 {
     if (CallbackEvent != null)
     {
         CallbackEvent(this, e);
     }
 }
 private void Plugins_Callback(object source, PluginContract.PluginEventArgs e)
 {
     if (e.MessageType == PluginEventMessageType.Message)
     {
         EventLogger.LogEvent(e.ResultMessage, EventLogEntryType.Information);
         Console.WriteLine(e.executingDomain + " - " + e.pluginName + " - " + e.ResultMessage); // for debug
     }
     else if (e.MessageType == PluginEventMessageType.Action)
     {
         if (e.EventAction.ActionToTake == PluginActionType.UpdateWithInstaller)
         {
             Console.WriteLine("****  DIE DIE DIE!!!! ... all plugins should be DEAD and UNLOADED at this stage ****");
             EventLogger.LogEvent("Update with installer event received", EventLogEntryType.Information);
             // Plugin manager takes care of shutting things down before calling update so we are safe to proceed...
             if (UseInstallerVersion == 1)
             {
                 EventLogger.LogEvent("Using installer 1", EventLogEntryType.Information);
                 UseInstallerVersion = 2;
                 // run installer1 in silent mode - it should replace files, and tell service to re-start
             }
             else if (UseInstallerVersion == 2)
             {
                 EventLogger.LogEvent("Using installer 2", EventLogEntryType.Information);
                 // run installer2 in silent mode - it should replace files, and tell service to re-start
                 UseInstallerVersion = 1;
             }
         }
     }
 }