Exemplo n.º 1
0
        public override bool Init(Main Main, System.Diagnostics.Stopwatch swInit)
        {
            if (!Main.EventMgr.PluginExists <Events.Screen>())
            {
                this.Log.LogLine("Task \"LogScreenEvents\" is missing EventPlugin \"Screen\"!", Log.Type.Error);
                return(false);
            }

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

            swInit.Stop();
            Events.Screen screenEvents = Main.EventMgr.GetPlugin <Events.Screen>();
            swInit.Start();

            screenEvents.ScreenAdded              += new Events.EventPlugin.EventValue <ScreenEx>(screenEvents_ScreenAdded);
            screenEvents.ScreenRemoved            += new Events.EventPlugin.EventValue <ScreenEx>(screenEvents_ScreenRemoved);
            screenEvents.ScreenColorDepthChanged  += new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_ScreenColorDepthChanged);
            screenEvents.ScreenResolutionChanged  += new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_ScreenResolutionChanged);
            screenEvents.PrimaryScreenChanged     += new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_PrimaryScreenChanged);
            screenEvents.ScreenLocationChanged    += new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_ScreenLocationChanged);
            screenEvents.ScreenOrientationChanged += new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_ScreenOrientationChanged);
            screenEvents.ScreenRefreshRateChanged += new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_ScreenRefreshRateChanged);
            return(true);
        }
Exemplo n.º 2
0
 public override void Dispose()
 {
     Events.Screen screenEvents = Main.EventMgr.GetPlugin <Events.Screen>();
     screenEvents.ScreenAdded              -= new Events.EventPlugin.EventValue <ScreenEx>(screenEvents_ScreenAdded);
     screenEvents.ScreenRemoved            -= new Events.EventPlugin.EventValue <ScreenEx>(screenEvents_ScreenRemoved);
     screenEvents.ScreenColorDepthChanged  -= new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_ScreenColorDepthChanged);
     screenEvents.ScreenResolutionChanged  -= new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_ScreenResolutionChanged);
     screenEvents.PrimaryScreenChanged     -= new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_PrimaryScreenChanged);
     screenEvents.ScreenLocationChanged    -= new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_ScreenLocationChanged);
     screenEvents.ScreenOrientationChanged -= new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_ScreenOrientationChanged);
     screenEvents.ScreenRefreshRateChanged -= new Events.EventPlugin.EventValues <ScreenEx>(screenEvents_ScreenRefreshRateChanged);
 }