private IAmbientSettingsSet?GetAmbientValueSet() { _settingInfo.UpdateLastUsed(); AmbientService <IAmbientSettingsSet> settingsSet = _settingsSet ?? _AmbientSettingsSet; // is there a local settings set override? IAmbientSettingsSet?localSettingsSetOverride = settingsSet.Override; if (localSettingsSetOverride != null) { return(localSettingsSetOverride); } // is there a local settings set suppression? IAmbientSettingsSet?localSettingsSet = settingsSet.Local; return((localSettingsSet != null) ? GetValueSet() // fall through to the base (global settings set) : null); // use the default value }
/// <summary> /// Gets the <see cref="AmbientService{T}"/> for the indicated type. /// </summary> /// <typeparam name="T">The type of service that is needed.</typeparam> /// <param name="service">[OUT] Receives the ambient service.</param> /// <returns>The <see cref="AmbientService{T}"/> instance. This should never be null.</returns> public static AmbientService <T> GetService <T>(out AmbientService <T> service) where T : class { service = AmbientService <T> .Instance; return(service); }
internal AmbientSetting(AmbientService <IAmbientSettingsSet> settingsSet, string key, string description, T defaultValue, Func <string, T> convert) : base(settingsSet, key, description, defaultValue, convert) { }
internal SettingsSetSetting(AmbientService <IAmbientSettingsSet> settings, string key, string description, T defaultValue, Func <string, T>?convert) { _settingInfo = new SettingInfo <T>(key, description, defaultValue, convert); _settingsSet = settings; }