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

            SetupNotifyIcon();
        }
Exemplo n.º 2
0
        protected override void OnExit(ExitEventArgs e)
        {
            _hotkeyHandler.Dispose();
            _taskbarIcon.Dispose();

            base.OnExit(e);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 5
0
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            //close the notify icon
            notifyIcon.Dispose();
        }
Exemplo n.º 6
0
        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;
        }
Exemplo n.º 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);
 }
Exemplo n.º 8
0
 protected override void OnExit(ExitEventArgs e)
 {
     WallpaperManager.Dispose();
     NLog.LogManager.Shutdown();
     notifyIcon.Dispose();
     base.OnExit(e);
 }
Exemplo n.º 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);
        }
Exemplo n.º 10
0
 private void CleanupNotifyIcon()
 {
     if (notifyIcon != null)
     {
         notifyIcon.Dispose();
     }
 }
Exemplo n.º 11
0
 protected override void OnExit(ExitEventArgs e)
 {
     LiveWallpaperEngineAPI.WallpaperManager.Instance.Dispose();
     NLog.LogManager.Shutdown();
     notifyIcon.Dispose();
     base.OnExit(e);
 }
Exemplo n.º 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;
            }
        }
Exemplo n.º 13
0
        protected override void OnExit(ExitEventArgs e)
        {
            notifyIcon.Dispose();
            SingleInstance <App> .Cleanup();

            base.OnExit(e);
        }
Exemplo n.º 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();
        }
Exemplo n.º 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( );
        }
Exemplo n.º 17
0
 private void App_OnExit(object sender, ExitEventArgs e)
 {
     if (!_taskbarIcon.IsDisposed)
     {
         _taskbarIcon.Dispose();
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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();
        }
Exemplo n.º 20
0
 public void Dispose()
 {
     if (TaskbarIcon != null)
     {
         TaskbarIcon.Visibility = Visibility.Collapsed;
         TaskbarIcon.Dispose();
     }
 }
Exemplo n.º 21
0
 protected override void OnExit(ExitEventArgs e)
 {
     trayIcon?.Dispose();
     serviceProvider.Dispose();
     OverlayController.Dispose();
     PredictionController.Dispose();
     base.OnExit(e);
 }
Exemplo n.º 22
0
 protected override void OnDetaching()
 {
     base.OnDetaching();
     icon.TrayMouseDoubleClick -= OnTrayDoubleClick;
     icon.Dispose();
     AssociatedObject.Closing -= OnWindowClosing;
     hwndSource.RemoveHook(OnHwndSourceHook);
 }
Exemplo n.º 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);
        }
Exemplo n.º 24
0
 protected override void OnExit(ExitEventArgs e)
 {
     notifyIcon.Dispose();
     displayRootRegistry.UnregisterWindowType <MainViewModel>();
     displayRootRegistry.UnregisterWindowType <DialogViewModel>();
     displayRootRegistry.UnregisterWindowType <ReklamaViewModel>();
     base.OnExit(e);
 }
Exemplo n.º 25
0
 public void Dispose()
 {
     if (icon != null)
     {
         icon.Dispose();
         icon = null;
     }
 }
Exemplo n.º 26
0
 public void Dispose()
 {
     if (_trayIcon != null)
     {
         _trayIcon.Dispose();
         _trayIcon = null;
     }
 }
Exemplo n.º 27
0
 private void MainWindow_OnClosing(object sender, CancelEventArgs e)
 {
     if (TaskbarIcon != null)
     {
         TaskbarIcon.Icon = null;
         TaskbarIcon.Dispose();
     }
 }
Exemplo n.º 28
0
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     taskbarIcon.Dispose();
     connectivityMonitor.Dispose();
     soundPlayeronhb.Dispose();
     SoundPlayertransition_on.Dispose();
 }
Exemplo n.º 29
0
 public void RemoveNotifyIcon()
 {
     if (notifyIcon != null)
     {
         notifyIcon.Visibility = Visibility.Hidden;
         notifyIcon.Dispose();
     }
 }
Exemplo n.º 30
0
 private static void exit(object sender, EventArgs e)
 {
     if (RU.IsInitialized)
     {
         RU.Close();
     }
     tbi.Dispose();
 }