示例#1
0
        private static void OnExit(object sender, EventArgs e)
        {
            // Clear tray icon on close
            if (TrayIcon != null)
            {
                TrayIcon.Visible = false;
            }

            // On send clear priority
            if (_protoClient != null)
            {
                _captureEnabled = false;
                ProtoClient.ClearPriority(Settings.HyperionMessagePriority);
                Thread.Sleep(50);
                ProtoClient.ClearPriority(Settings.HyperionMessagePriority);
                ProtoClient.Disconnect();
            }

            if (Settings.ApiEnabled)
            {
                _apiServer.StopServer();
            }

            Environment.Exit(0);
        }
示例#2
0
 private void TrayIcon_DoubleClick
     (object sender, EventArgs e)
 {
     if (CaptureEnabled)
     {
         TrayIcon.Icon = Resources.Hyperion_disabled;
         TrayIcon.Text = @"Hyperion Screen Capture (Disabled)";
         _protoClient.ClearPriority(HyperionMessagePriority);
         CaptureEnabled = false;
     }
     else
     {
         TrayIcon.Icon  = Resources.Hyperion_enabled;
         TrayIcon.Text  = @"Hyperion Screen Capture (Enabled)";
         CaptureEnabled = true;
         Thread.Sleep(50);
         Thread t = new Thread(StartCapture)
         {
             IsBackground = true
         };
         t.Start();
     }
 }
示例#3
0
        public static void ToggleCapture(string command)
        {
            if (_captureEnabled && command == "OFF")
            {
                _captureEnabled = false;

                TrayIcon.Icon = Resources.Hyperion_disabled;
                TrayIcon.Text = @"Hyperion Screen Capture (Disabled)";
                ProtoClient.ClearPriority(Settings.HyperionMessagePriority);
            }
            else if (!_captureEnabled && command == "ON")
            {
                _captureEnabled = true;

                TrayIcon.Icon = Resources.Hyperion_enabled;
                TrayIcon.Text = @"Hyperion Screen Capture (Enabled)";
                Thread.Sleep(50);
                var t = new Thread(StartCapture)
                {
                    IsBackground = true
                };
                t.Start();
            }
        }