示例#1
0
        public StorageLocation?GetSettingLocation(string key)
        {
            StorageLocation?result = null;

            lockSlim.EnterReadLock();
            try
            {
                if (localStore.Status == SettingsStoreStatus.Ready && localStore.Contains(key))
                {
                    result = StorageLocation.Local;
                }
                else if (localStore != roamingStore && roamingStore.Status == SettingsStoreStatus.Ready && roamingStore.Contains(key))
                {
                    result = StorageLocation.Roaming;
                }
                else if (transientStore.Status == SettingsStoreStatus.Ready && transientStore.Contains(key))
                {
                    result = StorageLocation.Transient;
                }
            }
            finally
            {
                lockSlim.ExitReadLock();
            }

            return(result);
        }
示例#2
0
 public void LoadValues(ISettingsStore store)
 {
     if (store.Contains("Profiles"))
     {
         _profiles = store.Get("Profiles", new List <BuildProfile>());
     }
 }
示例#3
0
 public void LoadValues(ISettingsStore store)
 {
     if (store.Contains("Environments"))
     {
         _environments = (EnvironmentCollection)store.Get(typeof(EnvironmentCollection), "Environments") ?? new EnvironmentCollection();
     }
 }
示例#4
0
        public void LoadValues(ISettingsStore store)
        {
            if (!store.Contains("Associations"))
            {
                return;
            }

            var associations = store.Get("Associations", new FileAssociations());

            AssociateExtensionHandlers(associations.Where(x => x.Value).Select(x => x.Key));
        }
示例#5
0
 public void LoadValues(ISettingsStore store)
 {
     _registeredHotkeys.Clear();
     if (store.Contains("Bindings"))
     {
         var bindings = store.Get("Bindings", new HotkeyBindings());
         foreach (var val in _hotkeys.Keys)
         {
             var hk = bindings.ContainsKey(val) && bindings[val] != null ? bindings[val] : _hotkeys[val].DefaultHotkey;
             if (hk != null && !_registeredHotkeys.ContainsKey(hk))
             {
                 _registeredHotkeys.Add(hk, _hotkeys[val]);
             }
         }
     }
 }