Ignore:
Timestamp:
11/14/2008 8:43:37 AM (4 years ago)
Author:
lowjoel
Message:

-The EraserSettings? class should belong in Program.cs
-Defined a few defaults:

-File erasure method: Gutmann (35)
-Unused space: Pseudorandom (1)
-PRNG: RNGCryptoServiceProvider
-UI language: whatever the current UI culture is

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Eraser/Program.cs

    r561 r562  
    163163            //Open the registry key containing the settings 
    164164            RegistryKey pluginsKey = Application.UserAppDataRegistry.OpenSubKey( 
    165                 "Plugins\\" + guid.ToString(), true); 
     165                guid.ToString(), true); 
    166166            if (pluginsKey == null) 
    167167                pluginsKey = Application.UserAppDataRegistry.CreateSubKey( 
    168                     "Plugins\\" + guid.ToString()); 
     168                    guid.ToString()); 
    169169 
    170170            //Return the Settings object. 
     
    172172        } 
    173173    } 
     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    } 
    174232} 
Note: See TracChangeset for help on using the changeset viewer.