@@ -45,6 +45,11 @@ protected enum Source
4545 /// <summary>Translates name of a setting to its source</summary>
4646 protected readonly Dictionary < string , Source > Sources = new Dictionary < string , Source > ( ) ;
4747
48+ /// <summary>
49+ /// True when the user settings store is in use and will be read from and written to.
50+ /// </summary>
51+ protected bool AllowUserSettings { get ; private set ; }
52+
4853 /// <summary>
4954 /// Constructor
5055 /// </summary>
@@ -76,9 +81,8 @@ protected SettingsBase(SettingsStore settings)
7681 /// <summary>
7782 /// Load all settings, possibly partly from the given options
7883 /// </summary>
79- /// <param name="allowUserSettings">Are user settings allowed?</param>
8084 /// <param name="optionsDictionary">???</param>
81- protected abstract void Load ( bool allowUserSettings , Dictionary < string , string > optionsDictionary ) ;
85+ protected abstract void Load ( Dictionary < string , string > optionsDictionary ) ;
8286
8387 /// <summary>
8488 /// Save all settings to the store
@@ -103,7 +107,7 @@ protected SettingsBase(SettingsStore settings)
103107 protected void Load ( IEnumerable < string > options )
104108 {
105109 // This special command-line option prevents the registry values from being used.
106- var allowUserSettings = ! options . Contains ( "skip-user-settings" , StringComparer . OrdinalIgnoreCase ) ;
110+ AllowUserSettings = ! options . Contains ( "skip-user-settings" , StringComparer . OrdinalIgnoreCase ) ;
107111
108112 // Pull apart the command-line options so we can find them by setting name.
109113 var optionsDictionary = new Dictionary < string , string > ( ) ;
@@ -114,23 +118,22 @@ protected void Load(IEnumerable<string> options)
114118 optionsDictionary [ k ] = v ;
115119 }
116120
117- Load ( allowUserSettings , optionsDictionary ) ;
121+ Load ( optionsDictionary ) ;
118122 }
119123
120124 /// <summary>
121125 /// Load a single value from the store, once type of the setting is known
122126 /// </summary>
123- /// <param name="allowUserSettings">Are user settings allowed for this setting?</param>
124127 /// <param name="optionsDictionary">???</param>
125128 /// <param name="name">name of the setting</param>
126129 /// <param name="type">type of the setting</param>
127- protected void Load ( bool allowUserSettings , Dictionary < string , string > optionsDictionary , string name , Type type )
130+ protected void Load ( Dictionary < string , string > optionsDictionary , string name , Type type )
128131 {
129132 // Get the default value.
130133 var defValue = GetDefaultValue ( name ) ;
131134
132135 // Read in the user setting, if it exists.
133- var userValue = allowUserSettings ? SettingStore . GetUserValue ( name , type ) : null ;
136+ var userValue = AllowUserSettings ? SettingStore . GetUserValue ( name , type ) : null ;
134137
135138 // Read in the command-line option, if it exists into optValue.
136139 var propertyNameLower = name . ToLowerInvariant ( ) ;
0 commit comments