/// <summary> /// Creates a UserSettings object that stores its settings /// in the specified storage location in a section based /// on the class name. /// </summary> /// <param name="StorageOption">The storage location for the settings.</param> public UserSettingsBase(UserStorageOption StorageOption) { //mOption = UserStorageOption.IsolatedStorage; mOption = StorageOption; mSection = this.GetType().Name; }
/// <summary> /// Creates a UserSettings object that stores its settings /// in the specified storage location in a section named /// per the parameter value. /// </summary> /// <param name="StorageOption">The storage location for the settings.</param> /// <param name="Section">The section name in which the settings should be stored.</param> public UserSettingsBase(UserStorageOption StorageOption, string Section) { //mOption = UserStorageOption.IsolatedStorage; mOption = StorageOption; mSection = Section; }
/// <summary> /// Creates a new settings object of the specified type /// based on the currently logged in user, the specified /// section name and specified storage location. /// </summary> /// <param name="Type">The type of the settings object to return.</param> /// <param name="Section">The section name containing the settings.</param> /// <param name="StorageOption">The storage location of the settings.</param> /// <returns>The newly populated settings object.</returns> public static UserSettingsBase Restore(Type Type, string Section, UserStorageOption StorageOption) { switch (StorageOption) { case UserStorageOption.IsolatedStorage: return(RestoreFromIsolatedStorage(Type, Section)); case UserStorageOption.Registry: return(RestoreFromRegistry(Type, Section)); case UserStorageOption.File: return(RestoreFromFile(Type, Section)); } return(null); }
/// <summary> /// Creates a new, empty settings object. /// </summary> /// <param name="StorageOption">The location to store the settings.</param> public Setting(UserStorageOption StorageOption) : base(StorageOption) { }
/// <summary> /// Creates a new settings object of the specified type /// based on the currently logged in user, the specified /// section name and specified storage location. /// </summary> /// <param name="Type">The type of the settings object to return.</param> /// <param name="Section">The section name containing the settings.</param> /// <param name="StorageOption">The storage location of the settings.</param> /// <returns>The newly populated settings object.</returns> public static UserSettingsBase Restore(Type Type, string Section, UserStorageOption StorageOption) { switch (StorageOption) { case UserStorageOption.IsolatedStorage: return RestoreFromIsolatedStorage(Type, Section); case UserStorageOption.Registry: return RestoreFromRegistry(Type, Section); case UserStorageOption.File: return RestoreFromFile(Type, Section); } return null; }