Exemplo n.º 1
0
 public override void Dispose()
 {
     Events.Device devEvents = this.Main.EventMgr.GetPlugin <Events.Device>(new object[] { Main }, true);
     devEvents.DeviceArrived           -= new Events.EventPlugin.EventValue <Device>(devEvents_DeviceArrived);
     devEvents.DeviceQueryRemove       -= new Events.EventPlugin.EventValue <Device>(devEvents_DeviceQueryRemove);
     devEvents.DeviceQueryRemoveFailed -= new Events.EventPlugin.EventValue <Device>(devEvents_DeviceQueryRemoveFailed);
     devEvents.DeviceRemoved           -= new Events.EventPlugin.EventValue <Device>(devEvents_DeviceRemoved);
     devEvents.MediaInserted           -= new Events.EventPlugin.EventValue <Device>(devEvents_MediaInserted);
     devEvents.NetworkVolumeArrived    -= new Events.EventPlugin.EventValue <Device>(devEvents_NetworkVolumeArrived);
 }
Exemplo n.º 2
0
        public override bool Init(Main Main, System.Diagnostics.Stopwatch swInit)
        {
            if (!Main.EventMgr.PluginExists <Events.Device>())
            {
                this.Log.LogLine("Task \"LogDeviceEvents\" is missing EventPlugin \"Device\"!", Log.Type.Error);
                return(false);
            }

            this.Main = Main;
            this.Log  = Main.Log;

            swInit.Stop();
            Events.Device deviceEvents = Main.EventMgr.GetPlugin <Events.Device>(new object[] { Main }, true);
            swInit.Start();

            deviceEvents.DeviceArrived           += new Events.EventPlugin.EventValue <Device>(devEvents_DeviceArrived);
            deviceEvents.DeviceQueryRemove       += new Events.EventPlugin.EventValue <Device>(devEvents_DeviceQueryRemove);
            deviceEvents.DeviceQueryRemoveFailed += new Events.EventPlugin.EventValue <Device>(devEvents_DeviceQueryRemoveFailed);
            deviceEvents.DeviceRemoved           += new Events.EventPlugin.EventValue <Device>(devEvents_DeviceRemoved);
            deviceEvents.MediaInserted           += new Events.EventPlugin.EventValue <Device>(devEvents_MediaInserted);
            deviceEvents.NetworkVolumeArrived    += new Events.EventPlugin.EventValue <Device>(devEvents_NetworkVolumeArrived);
            return(true);
        }