Esempio n. 1
0
        /// <summary>
        /// Method that is called when the Application is passive
        /// </summary>
        /// <param name="sender">The object that called this method</param>
        /// <param name="args">The EventArgs</param>
        private void Passive(object sender, EventArgs args)
        {
            try
            {
                if (!Properties.Settings.Default.DisableOnInactive)
                {
                    return;
                }
                if (!_ramController.RamMonitorEnabled)
                {
                    return;
                }

                _ramController.DisableMonitor();
                Overlay.Visibility = Visibility.Visible;
            }
            catch (Exception ex)
            {
                _logController.AddLog(new ErrorLog(ex.Message));
                MessageBox.Show(ex.Message, "MemPlus", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Method that is called when the MainWindow is closing
 /// </summary>
 /// <param name="sender">The object that called this method</param>
 /// <param name="e">The CancelEventArgs</param>
 private void MainWindow_OnClosing(object sender, CancelEventArgs e)
 {
     if (Properties.Settings.Default.HideOnClose && Visibility == Visibility.Visible)
     {
         Hide();
         e.Cancel = true;
     }
     else
     {
         // Unregister any hotkeys, if applicable
         _hotKeyController?.Dispose();
         // Disable the RAM Monitor to prevent exceptions from being thrown
         _ramController?.DisableMonitor();
         TbiIcon?.Dispose();
     }
 }