Beispiel #1
0
        private static void LoadDnsEntryGroupNames()
        {
            var emptyGroupNames = new Dictionary<string, string>();
            var vt = new ValuesTracker(_valuesTrackerKey);
            vt.Load();
            var groupNames = vt.GetValue(HostEntryGroupNames, emptyGroupNames);

            foreach (var entry in _dnsEntries)
            {
                var key = entry.ToString();
                if (groupNames.ContainsKey(key))
                {
                    entry.GroupName = groupNames[key];
                }
            }
        }
Beispiel #2
0
 private static void SaveDnsEntryGroupNames()
 {
     var vt = new ValuesTracker(_valuesTrackerKey);
     var groupNames = new Dictionary<string, string>();
     foreach (var entry in _dnsEntries.Where(x => !string.IsNullOrWhiteSpace(x.GroupName)))
     {
         if (groupNames.ContainsKey(entry.ToString()))
         {
             groupNames[entry.ToString()] = entry.GroupName;
         }
         else
         {
             groupNames.Add(entry.ToString(), entry.GroupName);
         }
     }
     vt.AddValue(HostEntryGroupNames, groupNames);
     vt.Save();
 }