public override void Dispose() { Events.Network networkEvents = this.Main.EventMgr.GetPlugin <Events.Network>(); networkEvents.NetworkAvailabilityChanged -= networkEvents_NetworkAvailabilityChanged; networkEvents.NetworkInterfaceAdded -= networkEvents_NetworkInterfaceAdded; networkEvents.NetworkInterfaceRemoved -= networkEvents_NetworkInterfaceRemoved; networkEvents.IpAddressChanged -= networkEvents_IpAddrChanged; }
public override bool Init(Main Main, System.Diagnostics.Stopwatch swInit) { if (!Main.EventMgr.PluginExists <Events.Network>()) { this.Log.LogLine("Task \"LogNetworkEvents\" is missing EventPlugin \"Network\"!", Log.Type.Error); return(false); } this.Main = Main; this.Log = Main.Log; swInit.Stop(); Events.Network networkEvents = Main.EventMgr.GetPlugin <Events.Network>(); swInit.Start(); networkEvents.NetworkAvailabilityChanged += networkEvents_NetworkAvailabilityChanged; networkEvents.NetworkInterfaceAdded += networkEvents_NetworkInterfaceAdded; networkEvents.NetworkInterfaceRemoved += networkEvents_NetworkInterfaceRemoved; networkEvents.IpAddressChanged += networkEvents_IpAddrChanged; return(true); }