Exemplo n.º 1
0
        /// <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;
        }
Exemplo n.º 2
0
        /// <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;
        }
Exemplo n.º 3
0
        /// <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;
        }
Exemplo n.º 4
0
        /// <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);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a new, empty settings object.
 /// </summary>
 /// <param name="StorageOption">The location to store the settings.</param>
 public Setting(UserStorageOption StorageOption) : base(StorageOption)
 {
 }
Exemplo n.º 6
0
        /// <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;
        }
Exemplo n.º 7
0
        /// <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;
        }
Exemplo n.º 8
0
 /// <summary>
 /// Creates a new, empty settings object.
 /// </summary>
 /// <param name="StorageOption">The location to store the settings.</param>
 public Setting(UserStorageOption StorageOption)
     : base(StorageOption)
 {
 }