private static void DeleteRecentProjects(ISettingsManager manager, IVsUIShell uiShell)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (UserConfirmation("Are you sure you with to clear the list of recently opened solutions and projects?", uiShell))
            {
                ISettingsList list = manager.GetOrCreateList("CodeContainers.Offline", true);
                list.ClearAsync().FireAndForget();
            }
        }
예제 #2
0
 private void CombineSections()
 {
     _settings = new SettingsList();
     foreach (Section section in _sections)
     {
         foreach (Setting setting in section.Values)
         {
             _settings [setting.Key] = setting;
         }
     }
 }
예제 #3
0
        public void AddSettings(ISettingsList settings)
        {
            if (settings == null)
            {
                return;
            }

            foreach (Setting setting in settings.Values)
            {
                Add(setting);
            }
        }
        public void Process(ISettingsList settings)
        {
            if (settings == null)
                throw new ArgumentNullException("settings", "Processor cannot process an empty collection of settings.");

            _settings = settings;
            foreach (Setting setting in _settings.Values)
            {
                processedList.Clear();
                ProcessSetting(setting);
            }
        }
        public void Process(ISettingsList settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings", "Processor cannot process an empty collection of settings.");
            }

            _settings = settings;
            foreach (Setting setting in _settings.Values)
            {
                processedList.Clear();
                ProcessSetting(setting);
            }
        }
예제 #6
0
        public Dictionary <string, object> GetAll(Func <string, bool> keyFunction)
        {
            try
            {
                _lock.EnterReadLock();
                ValidateSettingsAreLoaded();

                Dictionary <string, object> results = new Dictionary <string, object> ();
                ISettingsList settings = _readOnlySettings;
                foreach (string key in AllSettings.Keys.Where(keyFunction))
                {
                    results.Add(key, settings [key]);
                }
                return(results);
            }
            finally
            {
                _lock.ExitReadLock();
            }
        }
예제 #7
0
        public T Get <T> (string key)
        {
            try
            {
                _lock.EnterReadLock();
                ValidateSettingsAreLoaded();

                ISettingsList settings = _readOnlySettings;
                if (!settings.ContainsKey(key))
                {
                    throw new KeyNotFoundException(String.Format("Key \"{0}\" was not found", key));
                }

                return((T)settings [key].Value);
            }
            finally
            {
                _lock.ExitReadLock();
            }
        }
예제 #8
0
        public string Get(string key)
        {
            try
            {
                _lock.EnterReadLock();
                ValidateSettingsAreLoaded();

                // todo: add a helper method
                ISettingsList settings = __readOnlySettings;
                if (!settings.ContainsKey(key))
                {
                    throw new KeyNotFoundException(String.Format("Key \"{0}\" was not found", key));
                }

                Setting result = settings [key];
                return((result.Value == null) ? string.Empty : result.Value.ToString());
            }
            finally
            {
                _lock.ExitReadLock();
            }
        }
예제 #9
0
 public void AddSettings(ISettingsList settings)
 {
     throw new ReadOnlyException("Cannot add items from the collection because it's readonly");
 }
예제 #10
0
 private void MakeSettingsReadOnly()
 {
     __readOnlySettings = _settings.ToReadOnly();
 }
 public void AddSettings (ISettingsList settings)
 {
     throw new ReadOnlyException ("Cannot add items from the collection because it's readonly");
 }