Ejemplo n.º 1
0
        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
        }
Ejemplo n.º 2
0
 /// <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);
 }
Ejemplo n.º 3
0
 internal AmbientSetting(AmbientService <IAmbientSettingsSet> settingsSet, string key, string description, T defaultValue, Func <string, T> convert)
     : base(settingsSet, key, description, defaultValue, convert)
 {
 }
Ejemplo n.º 4
0
 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;
 }