Exemplo n.º 1
0
        /// <summary>
        /// Shows the tooltip
        /// </summary>
        private void showToolTip(bool blockingState)
        {
            try
            {
                if (blockingState != this.inputBlocker.BlockInput)
                {
                    return;
                }

                this.trayIcon.Visible = true;
                if (blockingState)
                {
                    BalloonTooltip.Show(
                        $"Your keyboard and mouse is locked.{Environment.NewLine}Press \"{this.inputBlocker.UnblockingKey}\" to unlock.",
                        this.iconLock,
                        $"Hold \"{this.inputBlocker.UnblockingKey}\" to turn off the screen.",
                        5000);
                }
                else
                {
                    BalloonTooltip.Hide();
                }
            }
            catch { }
        }
Exemplo n.º 2
0
 private void onKeyPressed(Keys key)
 {
     if (this.shortcutSettingMode)
     {
         BalloonTooltip.Show($"Press desired key combination{Environment.NewLine}{(ActionKey)key}", this.iconLock);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Handles the exception
        /// </summary>
        public static void HandleException(Exception ex, bool debugOnly = true)
        {
#if !DEBUG
            if (debugOnly)
            {
                return;
            }
#endif
            BalloonTooltip.Show(Assembly.GetEntryAssembly().GetName().Name + " - Error", null, ex.ToString(), 5000);
        }
Exemplo n.º 4
0
        protected override void onTrayIconClick(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }

            var isRunning = this.isSqlRunning();

            try
            {
                BalloonTooltip.Show(isRunning ? "Stopping the SQL Server..." : "Starting the SQL Server...", this.toolTipIcon, () => this.switchSqlServer(!isRunning));
            }
            catch { }

            this.updateLook();
        }
Exemplo n.º 5
0
 private void onSetShortcutClick(object sender, EventArgs e)
 {
     this.inputBlocker.Enabled = false;
     this.shortcutSettingMode  = true;
     BalloonTooltip.Show($"Press desired key combination...", this.iconLock);
 }
Exemplo n.º 6
0
 private void onScreenTurnedOff()
 {
     BalloonTooltip.Show("..zzZ", this.iconScreen);
     BalloonTooltip.Activate();
 }
Exemplo n.º 7
0
 private void onScreenOffRequested()
 {
     BalloonTooltip.Show("Turning off the screen...", this.iconScreen);
 }