|
1 | 1 | using System; |
2 | | -using System.ComponentModel; |
3 | 2 | using System.Reflection; |
4 | 3 | using System.Windows; |
5 | 4 | using System.Windows.Input; |
6 | 5 | using System.Windows.Media; |
| 6 | +using Hardcodet.Wpf.TaskbarNotification; |
7 | 7 | using MemPlus.Business.Classes.EXPORT; |
8 | 8 | using MemPlus.Business.Classes.GUI; |
9 | 9 | using MemPlus.Business.Classes.LOG; |
@@ -621,16 +621,6 @@ private void ExportRamAnalyzerDataMenuItem_OnClick(object sender, RoutedEventArg |
621 | 621 | } |
622 | 622 | } |
623 | 623 |
|
624 | | - /// <summary> |
625 | | - /// Method that is called when the MainWindow is closing |
626 | | - /// </summary> |
627 | | - /// <param name="sender">The object that called this method</param> |
628 | | - /// <param name="e">The CancelEventArgs</param> |
629 | | - private void MainWindow_OnClosing(object sender, CancelEventArgs e) |
630 | | - { |
631 | | - TbiIcon.Visibility = Visibility.Hidden; |
632 | | - } |
633 | | - |
634 | 624 | /// <summary> |
635 | 625 | /// Method that is called when all logs should be exported |
636 | 626 | /// </summary> |
@@ -710,21 +700,28 @@ private async void ClearMemory(int index) |
710 | 700 | } |
711 | 701 |
|
712 | 702 | double ramSavings = _ramController.RamSavings / 1024 / 1024; |
| 703 | + string message; |
713 | 704 | if (ramSavings < 0) |
714 | 705 | { |
715 | 706 | ramSavings = Math.Abs(ramSavings); |
716 | 707 | _logController.AddLog(new RamLog("RAM usage increase: " + ramSavings.ToString("F2") + " MB")); |
717 | | - if (_statisticsMessage) |
718 | | - { |
719 | | - MessageBox.Show("Looks like your RAM usage has increased with " + ramSavings.ToString("F2") + " MB!", "MemPlus", MessageBoxButton.OK, MessageBoxImage.Information); |
720 | | - } |
| 708 | + message = "Looks like your RAM usage has increased with " + ramSavings.ToString("F2") + " MB!"; |
721 | 709 | } |
722 | 710 | else |
723 | 711 | { |
724 | 712 | _logController.AddLog(new RamLog("RAM usage decrease: " + ramSavings.ToString("F2") + " MB")); |
725 | | - if (_statisticsMessage) |
| 713 | + message = "You saved " + ramSavings.ToString("F2") + " MB of RAM!"; |
| 714 | + } |
| 715 | + |
| 716 | + if (_statisticsMessage) |
| 717 | + { |
| 718 | + if (Visibility == Visibility.Visible) |
| 719 | + { |
| 720 | + MessageBox.Show(message, "MemPlus", MessageBoxButton.OK, MessageBoxImage.Information); |
| 721 | + } |
| 722 | + else if (Visibility == Visibility.Hidden && TbiIcon.Visibility == Visibility.Visible) |
726 | 723 | { |
727 | | - MessageBox.Show("You saved " + ramSavings.ToString("F2") + " MB of RAM!", "MemPlus", MessageBoxButton.OK, MessageBoxImage.Information); |
| 724 | + TbiIcon.ShowBalloonTip("MemPlus", message, BalloonIcon.Info); |
728 | 725 | } |
729 | 726 | } |
730 | 727 |
|
|
0 commit comments