public override bool Init(Main Main, System.Diagnostics.Stopwatch swInit) { if (!Main.EventMgr.PluginExists <Events.Processes>()) { this.Log.LogLine("Task \"LogProcessStartedEvents\" is missing EventPlugin \"ProcessStarted\"!", Log.Type.Error); return(false); } this.Main = Main; this.Log = Main.Log; swInit.Stop(); Events.Processes procEvents = Main.EventMgr.GetPlugin <Events.Processes>(); swInit.Start(); procEvents.ProcessCreated += new Events.EventPlugin.EventValue <Process>(procEvents_ProcessCreated); procEvents.ProcessExited += new EventPlugin.EventValue <Process>(procEvents_ProcessExited); return(true); }
public override void Dispose() { Events.Processes procEvents = Main.EventMgr.GetPlugin <Events.Processes>(); procEvents.ProcessCreated -= new Events.EventPlugin.EventValue <Process>(procEvents_ProcessCreated); procEvents.ProcessExited -= new EventPlugin.EventValue <Process>(procEvents_ProcessExited); }