|
1 | 1 | using System; |
2 | 2 | using System.Windows; |
3 | 3 | using System.Windows.Media; |
4 | | -using MemPlus.Classes; |
| 4 | +using MemPlus.Classes.GUI; |
5 | 5 | using MemPlus.Classes.LOG; |
6 | 6 | using MemPlus.Classes.RAM; |
7 | 7 |
|
@@ -70,17 +70,21 @@ private async void BtnClearMemory_OnClick(object sender, RoutedEventArgs e) |
70 | 70 | double ramSavings = _ramController.RamSavings / 1024 / 1024; |
71 | 71 | if (ramSavings < 0) |
72 | 72 | { |
73 | | - MessageBox.Show("Looks like your RAM usage has increased with " + Math.Abs(ramSavings).ToString("F2") + " MB!", "MemPlus", MessageBoxButton.OK, MessageBoxImage.Information); |
| 73 | + ramSavings = Math.Abs(ramSavings); |
| 74 | + _logController.AddLog(new ApplicationLog("RAM usage increase: " + ramSavings.ToString("F2") + " MB")); |
| 75 | + MessageBox.Show("Looks like your RAM usage has increased with " + ramSavings.ToString("F2") + " MB!", "MemPlus", MessageBoxButton.OK, MessageBoxImage.Information); |
74 | 76 | } |
75 | 77 | else |
76 | 78 | { |
| 79 | + _logController.AddLog(new ApplicationLog("RAM usage decrease: " + ramSavings.ToString("F2") + " MB")); |
77 | 80 | MessageBox.Show("You saved " + ramSavings.ToString("F2") + " MB of RAM!", "MemPlus", MessageBoxButton.OK, MessageBoxImage.Information); |
78 | 81 | } |
79 | 82 |
|
80 | 83 | BtnClearMemory.IsEnabled = true; |
81 | 84 | } |
82 | 85 | catch (Exception ex) |
83 | 86 | { |
| 87 | + _logController.AddLog(new ApplicationLog(ex.Message)); |
84 | 88 | MessageBox.Show(ex.Message, "MemPlus", MessageBoxButton.OK, MessageBoxImage.Error); |
85 | 89 | } |
86 | 90 |
|
@@ -120,6 +124,7 @@ private void HomePageMenuItem_OnClick(object sender, RoutedEventArgs e) |
120 | 124 | } |
121 | 125 | catch (Exception ex) |
122 | 126 | { |
| 127 | + _logController.AddLog(new ApplicationLog(ex.Message)); |
123 | 128 | MessageBox.Show(ex.Message, "MemPlus", MessageBoxButton.OK, MessageBoxImage.Error); |
124 | 129 | } |
125 | 130 | } |
|
0 commit comments