Changeset 562
- Timestamp:
- 11/14/2008 8:43:37 AM (3 years ago)
- Location:
- branches/eraser6
- Files:
-
- 4 edited
-
Eraser/Program.cs (modified) (2 diffs)
-
Eraser/SettingsPanel.cs (modified) (1 diff)
-
Manager/Method.cs (modified) (1 diff)
-
Manager/Settings.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Eraser/Program.cs
r561 r562 163 163 //Open the registry key containing the settings 164 164 RegistryKey pluginsKey = Application.UserAppDataRegistry.OpenSubKey( 165 "Plugins\\" +guid.ToString(), true);165 guid.ToString(), true); 166 166 if (pluginsKey == null) 167 167 pluginsKey = Application.UserAppDataRegistry.CreateSubKey( 168 "Plugins\\" +guid.ToString());168 guid.ToString()); 169 169 170 170 //Return the Settings object. … … 172 172 } 173 173 } 174 175 internal class EraserSettings 176 { 177 public EraserSettings() 178 { 179 settings = Manager.ManagerLibrary.Instance.SettingsManager.ModuleSettings; 180 } 181 182 /// <summary> 183 /// Gets or sets the LCID of the language which the UI should be displayed in. 184 /// </summary> 185 public string Language 186 { 187 get 188 { 189 return settings["Language"] == null ? 190 GetCurrentCulture().Name : 191 (string)settings["Language"]; 192 } 193 set 194 { 195 settings["Language"] = value; 196 } 197 } 198 199 /// <summary> 200 /// Gets or sets a value on whether the main frame should be minimised to the 201 /// system notification area. 202 /// </summary> 203 public bool HideWhenMinimised 204 { 205 get 206 { 207 return settings["HideWhenMinimised"] == null ? 208 true : (bool)settings["HideWhenMinimised"]; 209 } 210 set 211 { 212 settings["HideWhenMinimised"] = value; 213 } 214 } 215 216 /// <summary> 217 /// Gets the current UI culture, correct to the top-level culture (i.e., English 218 /// instead of English (United Kingdom)) 219 /// </summary> 220 /// <returns>The CultureInfo of the current UI culture, correct to the top level.</returns> 221 private static CultureInfo GetCurrentCulture() 222 { 223 CultureInfo culture = CultureInfo.CurrentUICulture; 224 while (culture.Parent != CultureInfo.InvariantCulture) 225 culture = culture.Parent; 226 227 return culture; 228 } 229 230 private Manager.Settings settings; 231 } 174 232 } -
branches/eraser6/Eraser/SettingsPanel.cs
r561 r562 375 375 } 376 376 } 377 378 internal class EraserSettings379 {380 public EraserSettings()381 {382 settings = Manager.ManagerLibrary.Instance.SettingsManager.ModuleSettings;383 }384 385 /// <summary>386 /// Gets or sets a value containing the language the UI should be displayed in.387 /// </summary>388 public string Language389 {390 get391 {392 return (string)settings["Language"];393 }394 set395 {396 settings["Language"] = value;397 }398 }399 400 /// <summary>401 /// Gets or sets a value on whether the main frame should be minimised to the402 /// system notification area.403 /// </summary>404 public bool HideWhenMinimised405 {406 get407 {408 return (bool)settings["HideWhenMinimised"];409 }410 set411 {412 settings["HideWhenMinimised"] = value;413 }414 }415 416 private Manager.Settings settings;417 }418 377 } 419 378 -
branches/eraser6/Manager/Method.cs
r508 r562 451 451 } 452 452 453 454 453 /// <summary> 455 454 /// Allows plug-ins to register methods with the main program. Thread-safe. -
branches/eraser6/Manager/Settings.cs
r561 r562 116 116 get 117 117 { 118 return settings["DefaultFileErasureMethod"] == null ? Guid.Empty : 118 return settings["DefaultFileErasureMethod"] == null ? 119 new Guid("1407FC4E-FEFF-4375-B4FB-D7EFBB7E9922") : 119 120 (Guid)settings["DefaultFileErasureMethod"]; 120 121 } … … 134 135 get 135 136 { 136 return settings["DefaultUnusedSpaceErasureMethod"] == null ? Guid.Empty : 137 return settings["DefaultUnusedSpaceErasureMethod"] == null ? 138 new Guid("{BF8BA267-231A-4085-9BF9-204DE65A6641}") : 137 139 (Guid)settings["DefaultUnusedSpaceErasureMethod"]; 138 140 } … … 151 153 get 152 154 { 153 return settings["ActivePRNG"] == null ? Guid.Empty : 155 return settings["ActivePRNG"] == null ? 156 new Guid("{6BF35B8E-F37F-476e-B6B2-9994A92C3B0C}") : 154 157 (Guid)settings["ActivePRNG"]; 155 158 }
Note: See TracChangeset
for help on using the changeset viewer.
