private StaticTaskbarManager()
        {
            if (_myTaskbarIcon != null)
            {
                _myTaskbarIcon.Dispose();
            }

            SetupNotifyIcon();
        }
示例#2
0
        protected override void OnExit(ExitEventArgs e)
        {
            _hotkeyHandler.Dispose();
            _taskbarIcon.Dispose();

            base.OnExit(e);
        }
示例#3
0
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            //clean up notifyicon (would otherwise stay open until application finishes)
            TaskbarIcon.Dispose();

            base.OnClosing(e);
        }
示例#4
0
        public MainWindow()
        {
            AppDomain.CurrentDomain.UnhandledException       += CurrentDomainOnUnhandledException;
            Application.Current.DispatcherUnhandledException += ApplicationThreadException;

            Classes.ReportCompatabilityCleanup clean = new Classes.ReportCompatabilityCleanup();

            InitializeComponent();
            buildString = String.Format("Scoreboard : Build v" + Classes.UsefulFunctions.checkVersion().ToString() + " " + Classes.UsefulFunctions.RetrieveLinkerTimestamp().ToString());
            //Check if the program is already open, if so exit imediately
            if (checkIfAlreadyExists() == true)
            {
                TaskbarIcon.Dispose();
                MessageBox.Show("KeeperScoreboard Already Running");
                MessageBox.Show("KeeperScoreboard Already Running");
                Environment.Exit(0);
            }
            reloadReports();
            reloadServers();
            loadSettings();
            this.Title = buildString;
            Classes.CheckUpdate update = new Classes.CheckUpdate();
            // int i = 0 / crash();
            TaskbarIcon.ToolTip = buildString;
        }
示例#5
0
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            //close the notify icon
            notifyIcon.Dispose();
        }
        public TrayIconViewModel(App app)
        {
            _theApp   = app;
            _trayIcon = (TaskbarIcon)app.FindResource("TrayIcon");
            if (_trayIcon == null)
            {
                return;
            }

            InTray = false;
            _trayIcon.DataContext = this;
            // TODO: Load from settings
            if (!_trayModeEnabled)
            {
                _trayIcon.Visibility = Visibility.Collapsed;
                _trayIcon.Dispose();
                return;
            }
            var cm = new ContextMenu();

            cm.Items.Add(new MenuItem
            {
                Header  = "Exit Tray Sample App",
                Command = ExitApplication
            });
            _trayIcon.ContextMenu       = cm;
            _theApp.MainWindow.Closing += MainWindow_Closing;
        }
示例#7
0
 protected override void OnExit(ExitEventArgs e)
 {
     NotifyIconViewModel.Current.CleanUp();
     notifyIcon.Dispose(); //the icon would clean up automatically, but this is cleaner
     hotkeyManager.Dispose();
     base.OnExit(e);
 }
示例#8
0
 protected override void OnExit(ExitEventArgs e)
 {
     WallpaperManager.Dispose();
     NLog.LogManager.Shutdown();
     notifyIcon.Dispose();
     base.OnExit(e);
 }
示例#9
0
        protected override void OnExit(ExitEventArgs e)
        {
            notifyIcon.Dispose(); //the icon would clean up automatically, but this is cleaner
            timer.Stop();

            base.OnExit(e);
        }
示例#10
0
 private void CleanupNotifyIcon()
 {
     if (notifyIcon != null)
     {
         notifyIcon.Dispose();
     }
 }
示例#11
0
 protected override void OnExit(ExitEventArgs e)
 {
     LiveWallpaperEngineAPI.WallpaperManager.Instance.Dispose();
     NLog.LogManager.Shutdown();
     notifyIcon.Dispose();
     base.OnExit(e);
 }
示例#12
0
        private void DXWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            MessageBoxResult msgBoxResult = WinUIMessageBox.Show("Are you sure you want to exit?",
                                                                 "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (msgBoxResult == MessageBoxResult.Yes)
            {
                string query = "delete from Programs";
                ExecuteQuery(query);
                for (int i = 0; i < programs.Count; i++)
                {
                    string insertQuery = "INSERT INTO Programs (Id, Title, ProcessName, Brightness, Directory) VALUES('" + i +
                                         "', '" + programsTitleList[i] + "','" + programs[i] + "','" + brightnesses[i] +
                                         "','" + directoriesList[i] + "')";
                    ExecuteQuery(insertQuery);
                }
                TaskbarIcon.Dispose();
                Application.Current.Shutdown();
            }
            else
            {
                e.Cancel = true;
                return;
            }
        }
示例#13
0
        protected override void OnExit(ExitEventArgs e)
        {
            notifyIcon.Dispose();
            SingleInstance <App> .Cleanup();

            base.OnExit(e);
        }
示例#14
0
 public void Dispose()
 {
     icon.TrayBalloonTipClicked -= icon_TrayBalloonTipClicked;
     icon.TrayLeftMouseDown     -= icon_TrayMouseDown;
     icon.TrayRightMouseDown    -= icon_TrayMouseDown;
     icon.Dispose();
 }
        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            receiver.Stop();

            icon.Icon = null;
            icon.Dispose();
        }
示例#16
0
        /// <summary>
        ///     Called when the plugin shuts down.
        /// </summary>
        public override void OnShutdown( )
        {
            using (var key = Registry.CurrentUser.OpenSubKey(FeatureBrowserEmulation, true))
            {
                if (key != null)
                {
                    var valueNames = key.GetValueNames( ).ToList( );

                    if (valueNames.Contains("ReadiMon.vshost.exe"))
                    {
                        key.DeleteValue("ReadiMon.vshost.exe");
                    }

                    if (valueNames.Contains("ReadiMon.exe"))
                    {
                        key.DeleteValue("ReadiMon.exe");
                    }
                }
            }

            if (_notifyIcon != null)
            {
                _notifyIcon.Dispose( );
            }

            base.OnShutdown( );
        }
示例#17
0
 private void App_OnExit(object sender, ExitEventArgs e)
 {
     if (!_taskbarIcon.IsDisposed)
     {
         _taskbarIcon.Dispose();
     }
 }
示例#18
0
        protected override void OnExit(ExitEventArgs e)
        {
            FipHandler.Close();

            _notifyIcon.Dispose(); //the icon would clean up automatically, but this is cleaner

            _hwInfoTokenSource.Cancel();

            var hwInfoToken = _hwInfoTokenSource.Token;

            try
            {
                HWInfoTask?.Wait(hwInfoToken);
            }
            catch (OperationCanceledException)
            {
                Log.Info("HWInfo background task ended");
            }
            finally
            {
                _hwInfoTokenSource.Dispose();
            }


            Log.Info("exiting");

            base.OnExit(e);
        }
示例#19
0
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            //the notify icon only closes automatically on WPF applications
            //-> dispose the notify icon manually
            notifyIcon.Dispose();
        }
示例#20
0
 public void Dispose()
 {
     if (TaskbarIcon != null)
     {
         TaskbarIcon.Visibility = Visibility.Collapsed;
         TaskbarIcon.Dispose();
     }
 }
示例#21
0
 protected override void OnExit(ExitEventArgs e)
 {
     trayIcon?.Dispose();
     serviceProvider.Dispose();
     OverlayController.Dispose();
     PredictionController.Dispose();
     base.OnExit(e);
 }
示例#22
0
 protected override void OnDetaching()
 {
     base.OnDetaching();
     icon.TrayMouseDoubleClick -= OnTrayDoubleClick;
     icon.Dispose();
     AssociatedObject.Closing -= OnWindowClosing;
     hwndSource.RemoveHook(OnHwndSourceHook);
 }
示例#23
0
        //on main window closing
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            //need to hide all visible objects before closing window, or thay will stay visible
            taskbarIcon.CloseBalloon();
            taskbarIcon.Dispose();

            base.OnClosing(e);
        }
示例#24
0
 protected override void OnExit(ExitEventArgs e)
 {
     notifyIcon.Dispose();
     displayRootRegistry.UnregisterWindowType <MainViewModel>();
     displayRootRegistry.UnregisterWindowType <DialogViewModel>();
     displayRootRegistry.UnregisterWindowType <ReklamaViewModel>();
     base.OnExit(e);
 }
示例#25
0
 public void Dispose()
 {
     if (icon != null)
     {
         icon.Dispose();
         icon = null;
     }
 }
示例#26
0
 public void Dispose()
 {
     if (_trayIcon != null)
     {
         _trayIcon.Dispose();
         _trayIcon = null;
     }
 }
示例#27
0
 private void MainWindow_OnClosing(object sender, CancelEventArgs e)
 {
     if (TaskbarIcon != null)
     {
         TaskbarIcon.Icon = null;
         TaskbarIcon.Dispose();
     }
 }
示例#28
0
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     taskbarIcon.Dispose();
     connectivityMonitor.Dispose();
     soundPlayeronhb.Dispose();
     SoundPlayertransition_on.Dispose();
 }
示例#29
0
 public void RemoveNotifyIcon()
 {
     if (notifyIcon != null)
     {
         notifyIcon.Visibility = Visibility.Hidden;
         notifyIcon.Dispose();
     }
 }
示例#30
0
 private static void exit(object sender, EventArgs e)
 {
     if (RU.IsInitialized)
     {
         RU.Close();
     }
     tbi.Dispose();
 }