예제 #1
0
        private void buttonDoNotDisturb_Click(object sender, RoutedEventArgs e)
        {
            BlinkStickManager.GetInstance().SetDoNotDisturb();

            // hide main window
            this.Visibility = Visibility.Hidden;
        }
예제 #2
0
        private void buttonPhoneCall_Click(object sender, RoutedEventArgs e)
        {
            BlinkStickManager.GetInstance().SetPhoneCall();

            // hide main window
            this.Visibility = Visibility.Hidden;
        }
예제 #3
0
        /****************************************************/

        static void SystemEvents_SessionSwitch(object sender, Microsoft.Win32.SessionSwitchEventArgs e)
        {
            if (e.Reason == SessionSwitchReason.SessionLock)
            {
                BlinkStickManager.GetInstance().SetDoNotDisturb();
            }
            else if (e.Reason == SessionSwitchReason.SessionUnlock)
            {
                BlinkStickManager.GetInstance().RestoreLastState();
            }
        }
        static public BlinkStickManager GetInstance()
        {
            lock (lockGlobalAccess)
            {
                if (INSTANCE == null)
                {
                    INSTANCE = new BlinkStickManager();
                }

                return(INSTANCE);
            }
        }
예제 #5
0
        public MainWindow()
        {
            InitializeComponent();

            INSTANCE = this;

            this.Visibility = Visibility.Hidden;
            NotifyIcon notifyIcon = new NotifyIcon();

            // init instance (disconnect / connect monitor) and add this window as listener
            BlinkStickManager.GetInstance().AddListener(this);

            Microsoft.Win32.SystemEvents.SessionSwitch += new Microsoft.Win32.SessionSwitchEventHandler(SystemEvents_SessionSwitch);
        }
예제 #6
0
 private void FireShortcut()
 {
     if (keyPressedLeftCTRL && keyPressedLShift)
     {
         if (keyPressedF9)
         {
             BlinkStickManager.GetInstance().SetAvailable();
         }
         else if (keyPressedF10)
         {
             BlinkStickManager.GetInstance().SetBusy();
         }
         else if (keyPressedF11)
         {
             BlinkStickManager.GetInstance().SetDoNotDisturb();
         }
         else if (keyPressedF12)
         {
             BlinkStickManager.GetInstance().SetPhoneCall();
         }
     }
 }
예제 #7
0
        public AboutWindow()
        {
            InitializeComponent();

            MainWindow mainWindow = MainWindow.GetInstance();

            if (mainWindow != null)
            {
                this.Owner = mainWindow;
            }

            this.Title = this.Title + " " + EnvironmentUtils.getApplicationName();

            string currentVersion = EnvironmentUtils.GetCurrentVersion();

            textBlockVersion.Text = "BlinkStick Busylight Client" + " v." + currentVersion;

            textBoxTeam.Text = "Christian Knobloch" + Environment.NewLine + "";

            String tempText = BlinkStickManager.GetInstance().GetDeviceInformation();

            tempText = tempText.Replace("\n", Environment.NewLine);
            textBoxDeviceInfo.Text = BlinkStickManager.GetInstance().GetDeviceInformation();
        }
예제 #8
0
        private void buttonSetAdvanced_Click(object sender, RoutedEventArgs e)
        {
            if (textBoxDelay.Text.Length == 0)
            {
                textBoxDelay.Text = "0";
            }

            if (textBoxSleep.Text.Length == 0)
            {
                textBoxSleep.Text = "0";
            }

            string color = colorPicker.SelectedColorText;
            int    delay = Int32.Parse(textBoxDelay.Text);
            int    sleep = Int32.Parse(textBoxSleep.Text);

            if (radioButtonMode1.IsChecked == true)
            {
                BlinkStickManager.GetInstance().SetColor(color);
            }
            else if (radioButtonMode2.IsChecked == true)
            {
                BlinkStickManager.GetInstance().MorphColor(color, delay);
            }
            else if (radioButtonMode3.IsChecked == true)
            {
                BlinkStickManager.GetInstance().BlinkColor(color, delay, sleep);
            }
            else if (radioButtonMode4.IsChecked == true)
            {
                BlinkStickManager.GetInstance().PulseColor(color, delay, sleep);
            }

            // hide main window
            this.Visibility = Visibility.Hidden;
        }
예제 #9
0
        /****************************************************/
        /****************************************************/

        // BlinkStick Action Listener
        public void OnConnect()
        {
            BlinkStickManager.GetInstance().SetAvailable();
        }
 private void SetStatusTurnOff(Object sender, EventArgs e)
 {
     BlinkStickManager.GetInstance().TurnOff();
 }
 private void SetStatusDoNotDisturb(Object sender, EventArgs e)
 {
     BlinkStickManager.GetInstance().SetDoNotDisturb();
 }
 private void SetStatusAvailable(Object sender, EventArgs e)
 {
     BlinkStickManager.GetInstance().SetAvailable();
 }
 private void SetStatusBusy(Object sender, EventArgs e)
 {
     BlinkStickManager.GetInstance().SetBusy();
 }
예제 #14
0
        public void Close()
        {
            BlinkStickManager.GetInstance().TurnOff(true);

            globalKeyboardHook.UnHookKeyboard();
        }