예제 #1
0
        private void Switch_IsEnabled()
        {
            if (this.AppConfig.IsEnabled)
            {
                if (ThreadStateController.SetDefault())
                {
                    this.AppConfig.IsEnabled = false;
                }
                else
                {
                    // TBD: Show Error
                }
            }
            else
            {
                if (ThreadStateController.SetBusy())
                {
                    this.AppConfig.IsEnabled = true;
                }
                else
                {
                    // TBD: Show Error
                }
            }

            this.AppConfig.RefreshUI();
            ShowBaloonTip();
        }
예제 #2
0
        private void MinuteTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            if ((this.AppConfig.IsRefreshEnabled) && (!this.SessionCurrentlyLocked))
            {
                CommandTargetWindow cmdTarget = new CommandTargetWindow();

                ThreadStateController.SetBusy();
                ThreadStateController.SetForegroundWindow(cmdTarget.Handle);
                SendKeys.SendWait("%1");

                cmdTarget.Close();

#if DEBUG
                this.SystemTrayIcon.BalloonTipText = "Busy Refresh";
                this.SystemTrayIcon.ShowBalloonTip(1000);
#endif
            }
        }