@@ -83,13 +83,40 @@ private void LoadProperties()
8383 //RAM Monitor
8484 ChbRamMonitor . IsChecked = Properties . Settings . Default . RamMonitor ;
8585 ChbDisableInactive . IsChecked = Properties . Settings . Default . DisableOnInactive ;
86- ItbRamMonitorTimeout . Value = Properties . Settings . Default . RamMonitorInterval ;
86+
87+ int ramInterval = Properties . Settings . Default . RamMonitorInterval ;
88+ switch ( Properties . Settings . Default . RamMonitorIntervalIndex )
89+ {
90+ case 0 :
91+ ItbRamMonitorTimeout . Value = ramInterval ;
92+ break ;
93+ case 1 :
94+ ItbRamMonitorTimeout . Value = ramInterval / 1000 ;
95+ break ;
96+ case 2 :
97+ ItbRamMonitorTimeout . Value = ramInterval / 1000 / 60 ;
98+ break ;
99+ case 3 :
100+ ItbRamMonitorTimeout . Value = ramInterval / 1000 / 60 / 60 ;
101+ break ;
102+ }
103+ CboRamMonitorInterval . SelectedIndex = Properties . Settings . Default . RamMonitorIntervalIndex ;
87104
88105 ChbAutoOptimizePercentage . IsChecked = Properties . Settings . Default . AutoOptimizePercentage ;
89106 ItbAutoOptimizePercentage . Value = Properties . Settings . Default . AutoOptimizePercentageThreshold ;
90107
91108 ChbAutoOptimizeTimed . IsChecked = Properties . Settings . Default . AutoOptimizeTimed ;
92- ItbAutoOptimizeTimed . Value = Properties . Settings . Default . AutoOptimizeTimedInterval / 1000 / 60 ;
109+
110+ CboAutoOptimizeTimedIndex . SelectedIndex = Properties . Settings . Default . AutoOptimizeTimedIntervalIndex ;
111+ switch ( Properties . Settings . Default . AutoOptimizeTimedIntervalIndex )
112+ {
113+ case 0 :
114+ ItbAutoOptimizeTimed . Value = Properties . Settings . Default . AutoOptimizeTimedInterval / 1000 / 60 ;
115+ break ;
116+ case 1 :
117+ ItbAutoOptimizeTimed . Value = Properties . Settings . Default . AutoOptimizeTimedInterval / 1000 / 60 / 60 ;
118+ break ;
119+ }
93120
94121
95122 ChbFileSystemCache . IsChecked = Properties . Settings . Default . FileSystemCache ;
@@ -158,13 +185,45 @@ private void SaveProperties()
158185 //RAM Monitor
159186 if ( ChbRamMonitor . IsChecked != null ) Properties . Settings . Default . RamMonitor = ChbRamMonitor . IsChecked . Value ;
160187 if ( ChbDisableInactive . IsChecked != null ) Properties . Settings . Default . DisableOnInactive = ChbDisableInactive . IsChecked . Value ;
161- if ( ItbRamMonitorTimeout . Value != null ) Properties . Settings . Default . RamMonitorInterval = ( int ) ItbRamMonitorTimeout . Value ;
188+
189+ Properties . Settings . Default . RamMonitorIntervalIndex = CboRamMonitorInterval . SelectedIndex ;
190+ if ( ItbRamMonitorTimeout . Value != null )
191+ {
192+ int ramInterval = ( int ) ItbRamMonitorTimeout . Value ;
193+ switch ( CboRamMonitorInterval . SelectedIndex )
194+ {
195+ case 1 :
196+ ramInterval = ramInterval * 1000 ;
197+ break ;
198+ case 2 :
199+ ramInterval = ramInterval * 1000 * 60 ;
200+ break ;
201+ case 3 :
202+ ramInterval = ramInterval * 1000 * 60 * 60 ;
203+ break ;
204+ }
205+
206+ Properties . Settings . Default . RamMonitorInterval = ramInterval ;
207+ }
162208
163209 if ( ChbAutoOptimizePercentage . IsChecked != null ) Properties . Settings . Default . AutoOptimizePercentage = ChbAutoOptimizePercentage . IsChecked . Value ;
164210 if ( ItbAutoOptimizePercentage . Value != null ) Properties . Settings . Default . AutoOptimizePercentageThreshold = ( int ) ItbAutoOptimizePercentage . Value ;
165211
166212 if ( ChbAutoOptimizeTimed . IsChecked != null ) Properties . Settings . Default . AutoOptimizeTimed = ChbAutoOptimizeTimed . IsChecked . Value ;
167- if ( ItbAutoOptimizeTimed . Value != null ) Properties . Settings . Default . AutoOptimizeTimedInterval = ( int ) ItbAutoOptimizeTimed . Value * 1000 * 60 ;
213+
214+ Properties . Settings . Default . AutoOptimizeTimedIntervalIndex = CboAutoOptimizeTimedIndex . SelectedIndex ;
215+ if ( ItbAutoOptimizeTimed . Value != null )
216+ {
217+ switch ( CboAutoOptimizeTimedIndex . SelectedIndex )
218+ {
219+ case 0 :
220+ Properties . Settings . Default . AutoOptimizeTimedInterval = ( int ) ItbAutoOptimizeTimed . Value * 1000 * 60 ;
221+ break ;
222+ case 1 :
223+ Properties . Settings . Default . AutoOptimizeTimedInterval = ( int ) ItbAutoOptimizeTimed . Value * 1000 * 60 * 60 ;
224+ break ;
225+ }
226+ }
168227
169228 //RAM Optimizer
170229 if ( ChbFileSystemCache . IsChecked != null ) Properties . Settings . Default . FileSystemCache = ChbFileSystemCache . IsChecked . Value ;
0 commit comments