@@ -20,9 +20,7 @@ public partial class MainWindow
2020 public MainWindow ( )
2121 {
2222 _logController = new LogController ( ) ;
23- _logController . AddLog ( new ApplicationLog ( "Initializing MemPlus" ) ) ;
24-
25- _logController . LogAddedEvent += LogAddedEvent ;
23+ _logController . AddLog ( new ApplicationLog ( "Initializing MainWindow" ) ) ;
2624
2725 InitializeComponent ( ) ;
2826 ChangeVisualStyle ( ) ;
@@ -34,7 +32,7 @@ public MainWindow()
3432 app . Activated += Active ;
3533 app . Deactivated += Passive ;
3634
37- _logController . AddLog ( new ApplicationLog ( "Done initializing MemPlus " ) ) ;
35+ _logController . AddLog ( new ApplicationLog ( "Done initializing MainWindow " ) ) ;
3836 }
3937
4038 private void Active ( object sender , EventArgs args )
@@ -48,21 +46,16 @@ private void Passive(object sender, EventArgs args)
4846 _ramController . DisableMonitor ( ) ;
4947 Overlay . Visibility = Visibility . Visible ;
5048 }
51-
52- private static void LogAddedEvent ( Log log )
53- {
54- if ( log . LogType != LogType . Application ) return ;
55- Console . WriteLine ( "[" + log . GetDate ( ) + "] " + log . GetData ( ) ) ;
56- }
49+
5750
5851 internal void ChangeVisualStyle ( )
5952 {
60- _logController . AddLog ( new ApplicationLog ( "Changing MemPlus theme style" ) ) ;
53+ _logController . AddLog ( new ApplicationLog ( "Changing MainWindow theme style" ) ) ;
6154
6255 StyleManager . ChangeStyle ( this ) ;
6356 CgRamUsage . Scales [ 0 ] . Ranges [ 0 ] . Stroke = new SolidColorBrush ( Properties . Settings . Default . MetroColor ) ;
6457
65- _logController . AddLog ( new ApplicationLog ( "Done changing MemPlus theme style" ) ) ;
58+ _logController . AddLog ( new ApplicationLog ( "Done changing MainWindow theme style" ) ) ;
6659 }
6760
6861 private async void BtnClearMemory_OnClick ( object sender , RoutedEventArgs e )
@@ -98,5 +91,15 @@ private void ClearLogsMenuItem_OnClick(object sender, RoutedEventArgs e)
9891 {
9992 _logController . ClearLogs ( ) ;
10093 }
94+
95+ private void ExitMenuItem_OnClick ( object sender , RoutedEventArgs e )
96+ {
97+ Application . Current . Shutdown ( ) ;
98+ }
99+
100+ private void ApplicationLogsMenuItem_OnClick ( object sender , RoutedEventArgs e )
101+ {
102+ new ApplicationLogWindow ( _logController ) . ShowDialog ( ) ;
103+ }
101104 }
102105}
0 commit comments