Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="aWndHandle"></param>
        /// <param name="aDeviceName"></param>
        /// <param name="aHdmiPort"></param>
        public void Start(IntPtr aWndHandle, string aDeviceName, byte aHdmiPort)
        {
            //Assuming monitor is on when we start up
            MonitorPowerOn = true;

            //Create our power setting notifier and register the event we are interested in
            iSkipNextMonitorPowerNotification        = true;
            iPowerSettingNotifier                    = new PowerManager.SettingNotifier(aWndHandle);
            iPowerSettingNotifier.OnMonitorPowerOn  += OnMonitorPowerOn;
            iPowerSettingNotifier.OnMonitorPowerOff += OnMonitorPowerOff;

            //CEC
            Client = new Cec.Client(aDeviceName, aHdmiPort, CecDeviceType.PlaybackDevice);
            ConnectCecClient();
        }
Beispiel #2
0
 //
 public void Stop()
 {
     //
     if (iPowerSettingNotifier != null)
     {
         iPowerSettingNotifier.OnMonitorPowerOn  -= OnMonitorPowerOn;
         iPowerSettingNotifier.OnMonitorPowerOff -= OnMonitorPowerOff;
         iPowerSettingNotifier = null;
     }
     //
     if (Client != null)
     {
         Client.Close();
         Client.Dispose();
         Client = null;
     }
 }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormClientIdle_Load(object sender, EventArgs e)
        {
            //Prevents showing in the Open Task view (Windows Key + Tab)
            Visible = false;

            //Display client
            iClient = new Client();
            iClient.CloseOrderEvent += OnCloseOrder;
            iClient.Open();
            iClient.SetName("Idle");
            iClient.SetPriority(Priorities.Background);
            SetupDisplayClient();

            //Timer
            iTimer.Interval = IntervalToNextMinute();
            iTimer.Start();

            //Create our power setting notifier and register the event we are interested in
            iPowerSettingNotifier = new PowerManager.SettingNotifier(Handle);
            iPowerSettingNotifier.OnMonitorPowerOn  += OnMonitorPowerOn;
            iPowerSettingNotifier.OnMonitorPowerOff += OnMonitorPowerOff;
            MonitorPowerOn = true;
        }