private void BalloonContainer_OnHovered(object sender, RoutedEventArgs e)
        {
            //the tray icon assigned this attached property to simplify access
            TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);

            taskbarIcon.ResetBalloonCloseTimer();
        }
示例#2
0
        private void grid_MouseEnter(object sender, MouseEventArgs e)
        {
            if (isClosing)
            {
                return;
            }
            TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);

            taskbarIcon.ResetBalloonCloseTimer();
        }
        private void notifiWindowCloseBUtton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (isClosing)
            {
                return;
            }
            TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);

            taskbarIcon.ResetBalloonCloseTimer();
            taskbarIcon.CloseBalloon();
        }
        /// <summary>
        /// If the user hovers over the balloon, we don't close it.
        /// </summary>
        private void grid_MouseEnter(object sender, MouseEventArgs e)
        {
            //if we're already running the fade-out animation, do not interrupt anymore
            if (_isClosing)
            {
                return;
            }

            //the tray icon assigned this attached property to simplify access
            TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);

            taskbarIcon.ResetBalloonCloseTimer();
        }
示例#5
0
        /// <summary>
        /// If the users hovers over the balloon, we don't close it (main timer is stopped).
        /// </summary>
        private void grid_MouseEnter(object sender, MouseEventArgs e)
        {
            this.mainTimer.Stop();
            //Console.WriteLine("main timer stoped!");

            //if we're already running the fade-out animation, do not interrupt
            if (isClosing)
            {
                return;
            }

            //the tray icon assigned this attached property to simplify access
            TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);

            taskbarIcon.ResetBalloonCloseTimer();
        }
示例#6
0
 private void DoToggleStatus(Action showCallback = null)
 {
     if (_TaskbarIcon.CustomBalloon != null && _TaskbarIcon.CustomBalloon.IsOpen)
     {
         _CloseTimer.Change(Timeout.Infinite, Timeout.Infinite);
         _TaskbarIcon.CloseBalloon();
     }
     else
     {
         var popup = new TrayIconPopup(_WebServer, () => _TaskbarIcon.CloseBalloon(), DoOpenOptions, Shutdown);
         popup.MouseEnter += (sender, eventArgs) => { _TaskbarIcon.ResetBalloonCloseTimer(); _CloseTimer.Change(Timeout.Infinite, Timeout.Infinite); };
         popup.MouseLeave += (sender, eventArgs) => _CloseTimer.Change(5000, Timeout.Infinite);
         popup.Loaded     += (sender, eventArgs) => { showCallback?.Invoke(); showCallback = null; };
         _TaskbarIcon.ShowCustomBalloon(popup, PopupAnimation.Fade, 5000);
     }
 }
示例#7
0
 /// <summary>
 /// 触发事件(当鼠标进入该区域,将通知弹出)
 /// </summary>
 private void grid_MouseEnter(object sender, MouseEventArgs e)
 {
     try
     {
         //如果是
         if (isClosing)
         {
             return;
         }
         //the tray icon assigned this attached property to simplify access
         TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);
         taskbarIcon.ResetBalloonCloseTimer();
     }
     catch (Exception ex)
     {
         MethodLb.CreateLog(this.GetType().FullName, "grid_MouseEnter", ex.ToString(), sender, e);
     }
     finally
     {
     }
 }
示例#8
0
        private void Grid_MouseEnter_1(object sender, MouseEventArgs e)
        {
            TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);

            taskbarIcon.ResetBalloonCloseTimer();
        }
        private void init(string _path, WatchingObjectType _wType, TaskbarIcon _tb, Image _item_image, ControlButtons _buttons)
        {
            tb         = _tb;
            item_image = _item_image;
            Image img = ((Image)this.FindName("item_image"));

            if (_item_image != null)
            {
                img.Source = _item_image.Source;
            }

            this.path = _path;
            this.text_message.Text = _path;
            this.wType             = _wType;

            temp          = new System.Timers.Timer();
            temp.Interval = 2000;
            temp.Elapsed += new System.Timers.ElapsedEventHandler(customballoon_close);

            Button btn_copy_clipboard = ((Button)this.FindName("btn_copy_clipboard"));

            btn_copy_clipboard.Click += (sender, args) =>
            {
                if (tb.CustomBalloon != null)
                {
                    tb.CustomBalloon.IsOpen = false;
                }
                App.copy_clipboard_with_popup(_path);
            };
            if ((_buttons & ControlButtons.Clipboard) == 0)
            {
                btn_copy_clipboard.Visibility = Visibility.Hidden;
            }
            Button btn_execute_file = ((Button)this.FindName("btn_execute_file"));

            btn_execute_file.Click += (sender, args) =>
            {
                if (tb.CustomBalloon != null)
                {
                    tb.CustomBalloon.IsOpen = false;
                }
                if (File.Exists(_path) == true)
                {
                    Process.Start(_path);
                }
                else
                {
                    App.ShowMessage($"Файл {_path} ещё не загружен или удалён.");
                }
            };
            if ((_buttons & ControlButtons.Run) == 0)
            {
                btn_execute_file.Visibility = Visibility.Hidden;
            }


            this.MouseEnter += (sender, args) =>
            {
                tb.ResetBalloonCloseTimer();
                this.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x04, 0x7A, 0x95));
                //this.Visibility = Visibility.Hidden;
                if (temp.Enabled)
                {
                    temp.Stop();
                }
            };
            this.MouseLeave += (sender, args) =>
            {
                this.Background = new SolidColorBrush(Color.FromArgb(0xCC, 0x00, 0xAB, 0xD1));
                temp.Start();
            };

            /*
             * this.MouseDown += (sender, args) =>
             * {
             *  tb.CustomBalloon.IsOpen = false;
             *  //this.Visibility = Visibility.Hidden;
             *  App.gotoPathByWindowsExplorer(path, wType);
             * };
             * //*/
            this.ToolTipClosing += (sender, args) =>
            {
                temp.Stop();
            };
        }