Save() public static method

public static Save ( string key, string>.IEnumerable source ) : bool
key string
source string>.IEnumerable
return bool
Exemplo n.º 1
0
        public void Save(string priorityField, IEnumerable <KeyValuePair <string, string> > source)
        {
            var toSave = source as IList <KeyValuePair <string, string> > ?? source.ToList();

            toSave.Add(new KeyValuePair <string, string>("Field", priorityField));
            SettingsStore.Save(key, toSave);
        }
Exemplo n.º 2
0
        public void RestoreDefaults()
        {
            loadDefaultStates(tfsProject); // <===== REVISIT METHOD WHEN EXPOSING ON UI...
            var toStore = workItemStates.ToDictionary(state => state.Name, state => state.SelectedApprovedState);

            SettingsStore.Save(approved_key, toStore);
        }
Exemplo n.º 3
0
        public JiraTypeMap(ITicketSource jiraProject, IAvailableTicketTypes availableTicektTypes)
        {
            map             = new Dictionary <string, string>();
            jiraTicketTypes = jiraProject.GetAvailableTicketTypes();
            availableTypes  = availableTicektTypes;

            if (jiraTicketTypes.Count > 0)
            {
                map = SettingsStore.Load(key);
                var updateStore = false;
                foreach (
                    var jiraType in
                    jiraTicketTypes.Where(
                        jiraType =>
                        map.ContainsKey(jiraType) == false || availableTypes.Contains(map[jiraType]) == false))
                {
                    map[jiraType] = defaultsTo(jiraType);
                    updateStore   = true;
                }

                if (updateStore)
                {
                    SettingsStore.Save(key, map);
                }
            }
        }
Exemplo n.º 4
0
        public void Save()
        {
            var toSave = new Dictionary <string, string>();

            toSave[defaultAsigneeKey] = defaultAsignee;
            toSave[defaultCreatorKey] = defaultCreator;
            SettingsStore.Save(key, toSave);
        }
Exemplo n.º 5
0
 public void RestoreDefaults()
 {
     map = new Dictionary <string, string>();
     foreach (var jiraType in jiraTicketTypes)
     {
         map.Add(jiraType, defaultsTo(jiraType));
     }
     SettingsStore.Save(key, map);
 }
Exemplo n.º 6
0
        public void Save(IEnumerable <KeyValuePair <string, string> > source)
        {
            map.Clear();
            var keyValuePairs = source as KeyValuePair <string, string>[] ?? source.ToArray();

            foreach (var kp in keyValuePairs)
            {
                map.Add(kp.Key, kp.Value);
            }
            SettingsStore.Save(key, keyValuePairs);
        }
Exemplo n.º 7
0
 public void RestoreDefaults()
 {
     map = new Dictionary <string, string>
     {
         { "Field", "Priority" },
         /*Microsoft.VSTS.Common.Priority*/
         { "Blocker", "1" },
         { "Critical", "1" },
         { "Major", "2" },
         { "Medium", "3" },
         { "Minor", "4" },
         { "Trivial", "4" }
     };
     SettingsStore.Save(key, map);
 }
Exemplo n.º 8
0
 public void Save(IEnumerable <KeyValuePair <string, string> > approvedStates)
 {
     SettingsStore.Save(approved_key, approvedStates.ToDictionary(state => state.Key, state => state.Value));
 }
Exemplo n.º 9
0
        public void Save()
        {
            var map = fields.Names.ToDictionary(name => name, name => fields[name].DefaultValue);

            SettingsStore.Save(key, map);
        }