Skip to content

Commit 101e949

Browse files
committed
* Added controls to represent new settings
* Added code behind new settings
1 parent c7ba9a4 commit 101e949

File tree

5 files changed

+60
-11
lines changed

5 files changed

+60
-11
lines changed

MemPlus/App.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<value>False</value>
4545
</setting>
4646
<setting name="AutoOptimizePercentageThreshold" serializeAs="String">
47-
<value />
47+
<value>50</value>
4848
</setting>
4949
<setting name="AutoOptimizeTimed" serializeAs="String">
5050
<value>False</value>

MemPlus/Properties/Settings.Designer.cs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MemPlus/Properties/Settings.settings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
<Setting Name="AutoOptimizePercentage" Type="System.Boolean" Scope="User">
3939
<Value Profile="(Default)">False</Value>
4040
</Setting>
41-
<Setting Name="AutoOptimizePercentageThreshold" Type="System.String" Scope="User">
42-
<Value Profile="(Default)" />
41+
<Setting Name="AutoOptimizePercentageThreshold" Type="System.Int32" Scope="User">
42+
<Value Profile="(Default)">50</Value>
4343
</Setting>
4444
<Setting Name="AutoOptimizeTimed" Type="System.Boolean" Scope="User">
4545
<Value Profile="(Default)">False</Value>

MemPlus/Windows/SettingsWindow.xaml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
2626
<Grid.RowDefinitions>
2727
<RowDefinition Height="Auto"></RowDefinition>
28-
<RowDefinition Height="Auto"></RowDefinition>
2928
</Grid.RowDefinitions>
3029

3130
<GroupBox Grid.Row="0" Header="MemPlus" MinWidth="250" Margin="3">
@@ -40,8 +39,21 @@
4039

4140
</Grid>
4241
</GroupBox>
42+
</Grid>
43+
44+
</syncfusion:TabItemExt>
45+
46+
<syncfusion:TabItemExt Header="RAM Monitor"
47+
Image="../Resources/Images/monitor.png"
48+
ImageWidth="16"
49+
ImageHeight="16">
4350

44-
<GroupBox Grid.Row="1" Header="RAM Monitor" Margin="3">
51+
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
52+
<Grid.RowDefinitions>
53+
<RowDefinition Height="Auto"></RowDefinition>
54+
<RowDefinition Height="Auto"></RowDefinition>
55+
</Grid.RowDefinitions>
56+
<GroupBox Grid.Row="0" Header="RAM Monitor" Margin="3">
4557
<Grid MinWidth="250">
4658
<Grid.RowDefinitions>
4759
<RowDefinition Height="Auto"></RowDefinition>
@@ -65,11 +77,32 @@
6577
</Grid>
6678
</Grid>
6779
</GroupBox>
68-
</Grid>
80+
<GroupBox Grid.Row="1" Header="RAM Optimizer" Margin="3">
81+
<Grid MinWidth="250">
82+
<Grid.RowDefinitions>
83+
<RowDefinition Height="Auto"></RowDefinition>
84+
<RowDefinition Height="Auto"></RowDefinition>
85+
</Grid.RowDefinitions>
86+
<Grid.ColumnDefinitions>
87+
<ColumnDefinition Width="Auto"></ColumnDefinition>
88+
<ColumnDefinition Width="Auto"></ColumnDefinition>
89+
<ColumnDefinition Width="Auto"></ColumnDefinition>
90+
</Grid.ColumnDefinitions>
91+
92+
<CheckBox x:Name="ChbAutoOptimizePercentage" VerticalAlignment="Center" Grid.Row="0" Grid.Column="0" Content="Automatically optimize when RAM usage exceeds" Margin="3"/>
93+
<syncfusion:IntegerTextBox x:Name="ItbAutoOptimizePercentage" Grid.Row="0" Grid.Column="1" Margin="3" />
94+
<Label Grid.Row="0" Grid.Column="2" Content="%" Margin="3" />
95+
96+
<CheckBox x:Name="ChbAutoOptimizeTimed" VerticalAlignment="Center" Grid.Row="1" Grid.Column="0" Content="Automatically optimize after" Margin="3"/>
97+
<syncfusion:IntegerTextBox x:Name="ItbAutoOptimizeTimed" Grid.Row="1" Grid.Column="1" Margin="3" />
98+
<Label Grid.Row="1" Grid.Column="2" Content="minutes" Margin="3" />
6999

100+
</Grid>
101+
</GroupBox>
102+
</Grid>
70103
</syncfusion:TabItemExt>
71104

72-
<syncfusion:TabItemExt Header="Memory Optimizer"
105+
<syncfusion:TabItemExt Header="RAM Optimizer"
73106
Image="../Resources/Images/ram_tab.png"
74107
ImageWidth="16" ImageHeight="16">
75108

@@ -88,7 +121,7 @@
88121
<RowDefinition></RowDefinition>
89122
<RowDefinition Height="Auto"></RowDefinition>
90123
</Grid.RowDefinitions>
91-
<ListView x:Name="LsvExclusions" Margin="3" Height="100" Width="250">
124+
<ListView x:Name="LsvExclusions" Margin="3" Height="50" Width="250">
92125
<ListView.ContextMenu>
93126
<ContextMenu>
94127
<MenuItem Header="Copy" Click="CopyExclusionMenuItem_OnClick">

MemPlus/Windows/SettingsWindow.xaml.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,18 @@ private void LoadProperties()
7878
Topmost = false;
7979
}
8080

81+
//RAM Monitor
8182
ChbRamMonitor.IsChecked = Properties.Settings.Default.RamMonitor;
8283
ChbDisableInactive.IsChecked = Properties.Settings.Default.DisableOnInactive;
8384
ItbRamMonitorTimeout.Value = Properties.Settings.Default.RamMonitorInterval;
8485

86+
ChbAutoOptimizePercentage.IsChecked = Properties.Settings.Default.AutoOptimizePercentage;
87+
ItbAutoOptimizePercentage.Value = Properties.Settings.Default.AutoOptimizePercentageThreshold;
88+
89+
ChbAutoOptimizeTimed.IsChecked = Properties.Settings.Default.AutoOptimizeTimed;
90+
ItbAutoOptimizeTimed.Value = Properties.Settings.Default.AutoOptimizeTimedInterval / 1000 / 60;
91+
92+
8593
ChbFileSystemCache.IsChecked = Properties.Settings.Default.FileSystemCache;
8694
ChbStandByCache.IsChecked = Properties.Settings.Default.StandByCache;
8795
if (Properties.Settings.Default.ProcessExceptions != null)
@@ -121,10 +129,18 @@ private void SaveProperties()
121129
//General
122130
if (ChbAutoUpdate.IsChecked != null) Properties.Settings.Default.AutoUpdate = ChbAutoUpdate.IsChecked.Value;
123131
if (ChbTopmost.IsChecked != null) Properties.Settings.Default.Topmost = ChbTopmost.IsChecked.Value;
132+
133+
//RAM Monitor
124134
if (ChbRamMonitor.IsChecked != null) Properties.Settings.Default.RamMonitor = ChbRamMonitor.IsChecked.Value;
125135
if (ChbDisableInactive.IsChecked != null) Properties.Settings.Default.DisableOnInactive = ChbDisableInactive.IsChecked.Value;
126136
if (ItbRamMonitorTimeout.Value != null) Properties.Settings.Default.RamMonitorInterval = (int)ItbRamMonitorTimeout.Value;
127137

138+
if (ChbAutoOptimizePercentage.IsChecked != null) Properties.Settings.Default.AutoOptimizePercentage = ChbAutoOptimizePercentage.IsChecked.Value;
139+
if (ItbAutoOptimizePercentage.Value != null) Properties.Settings.Default.AutoOptimizePercentageThreshold = (int)ItbAutoOptimizePercentage.Value;
140+
141+
if (ChbAutoOptimizeTimed.IsChecked != null) Properties.Settings.Default.AutoOptimizeTimed = ChbAutoOptimizeTimed.IsChecked.Value;
142+
if (ItbAutoOptimizeTimed.Value != null) Properties.Settings.Default.AutoOptimizeTimedInterval = (int)ItbAutoOptimizeTimed.Value * 1000 * 60;
143+
128144
//RAM Optimizer
129145
if (ChbFileSystemCache.IsChecked != null) Properties.Settings.Default.FileSystemCache = ChbFileSystemCache.IsChecked.Value;
130146
if (ChbStandByCache.IsChecked != null) Properties.Settings.Default.StandByCache = ChbStandByCache.IsChecked.Value;

0 commit comments

Comments
 (0)