コード例 #1
0
 /// <summary>
 /// Applies this settings provider to each property of the given settings.
 /// </summary>
 /// <param name="settingsList">An array of settings.</param>
 public static void ApplyProvider(params ApplicationSettingsBase[] settingsList)
 {
     foreach (var settings in settingsList)
     {
         var provider = new VariableSettingsProvider();
         settings.Providers.Add(provider);
         foreach (SettingsProperty prop in settings.Properties)
         {
             prop.Provider = provider;
         }
         settings.Reload();
     }
 }
コード例 #2
0
 /// <summary>
 /// Makes the given array of settings portable together with the manager.
 /// </summary>
 /// <param name="settings">An array of custom settings.</param>
 public void MakePortable(params ApplicationSettingsBase[] settings)
 {
     VariableSettingsProvider.ApplyProvider(settings);
 }