/// <summary> /// Initializes a new instance of the <see cref="SettingsKey"/> class. /// </summary> /// <param name="name">The name of this settings key. Must be unique amongst the application.</param> /// <param name="container">The <see cref="SettingsContainer"/> containing this <see cref="SettingsKey"/>.</param> /// <param name="defaultValueCallback">A function that returns the default value associated to this settings key.</param> protected SettingsKey(UFile name, SettingsContainer container, Func <object> defaultValueCallback) { Name = name; DisplayName = name; DefaultObjectValueCallback = defaultValueCallback; Container = container; Container.RegisterSettingsKey(name, defaultValueCallback(), this); }
/// <summary> /// Initializes a new instance of the <see cref="SettingsKey"/> class. /// </summary> /// <param name="name">The name of this settings key. Must be unique amongst the application.</param> /// <param name="container">The <see cref="SettingsContainer"/> containing this <see cref="SettingsKey"/>.</param> /// <param name="defaultValueCallback">A function that returns the default value associated to this settings key.</param> protected SettingsKey(UFile name, SettingsContainer container, Func<object> defaultValueCallback) { Name = name; DisplayName = name; DefaultObjectValueCallback = defaultValueCallback; Container = container; Container.RegisterSettingsKey(name, defaultValueCallback(), this); }
/// <summary> /// Initializes a new instance of the <see cref="SettingsKey"/> class. /// </summary> /// <param name="name">The name of this settings key. Must be unique amongst the application.</param> /// <param name="container">The <see cref="SettingsContainer"/> containing this <see cref="SettingsKey"/>.</param> /// <param name="defaultValue">The default value associated to this settings key.</param> protected SettingsKey(UFile name, SettingsContainer container, object defaultValue) { Name = name; DisplayName = name; DefaultObjectValue = defaultValue; Container = container; Container.RegisterSettingsKey(name, defaultValue, this); }