Skip to content

Commit d224258

Browse files
committed
* Minor changes to SettingsWindow design
* Added initial AnalyzerWindow
1 parent d016862 commit d224258

File tree

6 files changed

+88
-2
lines changed

6 files changed

+88
-2
lines changed

MemPlus/MemPlus.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,20 @@
7070
<Generator>MSBuild:Compile</Generator>
7171
<SubType>Designer</SubType>
7272
</ApplicationDefinition>
73+
<Compile Include="Windows\AnalyzerWindow.xaml.cs">
74+
<DependentUpon>AnalyzerWindow.xaml</DependentUpon>
75+
</Compile>
7376
<Compile Include="Windows\SettingsWindow.xaml.cs">
7477
<DependentUpon>SettingsWindow.xaml</DependentUpon>
7578
</Compile>
7679
<Page Include="Windows\AboutWindow.xaml">
7780
<SubType>Designer</SubType>
7881
<Generator>MSBuild:Compile</Generator>
7982
</Page>
83+
<Page Include="Windows\AnalyzerWindow.xaml">
84+
<SubType>Designer</SubType>
85+
<Generator>MSBuild:Compile</Generator>
86+
</Page>
8087
<Page Include="Windows\LogWindow.xaml">
8188
<SubType>Designer</SubType>
8289
<Generator>MSBuild:Compile</Generator>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<syncfusion:ChromelessWindow
2+
x:Class="MemPlus.Windows.AnalyzerWindow"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:local="clr-namespace:MemPlus.Windows"
8+
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
9+
mc:Ignorable="d"
10+
UseLayoutRounding="True"
11+
TitleTextAlignment="Center"
12+
Title="MemPlus - RAM Analyzer" Height="350" Width="500" Icon="/MemPlus;component/Resources/Images/ram.png">
13+
<Grid>
14+
15+
</Grid>
16+
</syncfusion:ChromelessWindow>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using System;
2+
using System.Windows;
3+
using MemPlus.Classes.GUI;
4+
using MemPlus.Classes.LOG;
5+
6+
namespace MemPlus.Windows
7+
{
8+
/// <inheritdoc cref="Syncfusion.Windows.Shared.ChromelessWindow" />
9+
/// <summary>
10+
/// Interaction logic for AnalyzerWindow.xaml
11+
/// </summary>
12+
public partial class AnalyzerWindow
13+
{
14+
#region Variables
15+
/// <summary>
16+
/// The LogController object that can be used to add logs
17+
/// </summary>
18+
private readonly LogController _logController;
19+
#endregion
20+
21+
public AnalyzerWindow(LogController logController)
22+
{
23+
_logController = logController;
24+
_logController.AddLog(new ApplicationLog("Initializing AnalyzerWindow"));
25+
InitializeComponent();
26+
ChangeVisualStyle();
27+
LoadProperties();
28+
29+
_logController.AddLog(new ApplicationLog("Done initializing AnalyzerWindow"));
30+
}
31+
32+
/// <summary>
33+
/// Change the visual style of the controls, depending on the settings.
34+
/// </summary>
35+
private void ChangeVisualStyle()
36+
{
37+
_logController.AddLog(new ApplicationLog("Changing LogWindow theme style"));
38+
StyleManager.ChangeStyle(this);
39+
_logController.AddLog(new ApplicationLog("Done changing LogWindow theme style"));
40+
}
41+
42+
/// <summary>
43+
/// Load the properties of the application
44+
/// </summary>
45+
private void LoadProperties()
46+
{
47+
try
48+
{
49+
Topmost = Properties.Settings.Default.Topmost;
50+
}
51+
catch (Exception ex)
52+
{
53+
_logController.AddLog(new ApplicationLog(ex.Message));
54+
MessageBox.Show(ex.Message, "MemPlus", MessageBoxButton.OK, MessageBoxImage.Error);
55+
}
56+
}
57+
}
58+
}

MemPlus/Windows/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
<MenuItem Header="_Tools">
7373
<MenuItem x:Name="MniRamMonitor" Header="RAM Monitor" IsCheckable="True" Checked="RamMonitorMenuItem_OnCheckedChanged" Unchecked="RamMonitorMenuItem_OnCheckedChanged" />
74-
<MenuItem Header="RAM Analyzer">
74+
<MenuItem Header="RAM Analyzer" Click="RamAnalyzerMenuItem_OnClick">
7575
<MenuItem.Icon>
7676
<Image Width="16" Height="16" Source="/Resources/Images/ram.png"/>
7777
</MenuItem.Icon>

MemPlus/Windows/MainWindow.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,5 +536,10 @@ private void UpdateMenuItem_OnClick(object sender, RoutedEventArgs e)
536536
_updateManager.CheckForUpdate(true, true);
537537
_logController.AddLog(new ApplicationLog("Done checking for application updates"));
538538
}
539+
540+
private void RamAnalyzerMenuItem_OnClick(object sender, RoutedEventArgs e)
541+
{
542+
new AnalyzerWindow(_logController).Show();
543+
}
539544
}
540545
}

MemPlus/Windows/SettingsWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</Grid.RowDefinitions>
3838

3939
<CheckBox Grid.Row="0" x:Name="ChbAutoStart" Content="Automatic start MemPlus when Windows starts" Margin="3" />
40-
<CheckBox Grid.Row="1" x:Name="ChbStartMinimized" Content="Hide MemPlus when loaded" Margin="3" />
40+
<CheckBox Grid.Row="1" x:Name="ChbStartMinimized" Content="Hide MemPlus on startup" Margin="3" />
4141
<CheckBox Grid.Row="2" x:Name="ChbAutoUpdate" Content="Automatic updates" Margin="3" />
4242
<CheckBox Grid.Row="3" x:Name="ChbTopmost" Content="Topmost" Margin="3" />
4343

0 commit comments

Comments
 (0)