示例#1
0
 /// <summary>
 /// Remove all the elements that have the given key
 /// </summary>
 public void Remove(TK key)
 {
     lock (_lock)
     {
         AllItems.RemoveAll(v => v.Key.Equals(key));
         if (SingleItems.ContainsKey(key))
         {
             SingleItems.Remove(key);
         }
         else
         {
             RepeatedItems.Remove(key);
         }
     }
 }
示例#2
0
 /// <summary>
 /// Removes a specific value
 /// </summary>
 public void Remove(CfgNodeValue <TK, TV> keyVal)
 {
     lock (_lock)
     {
         AllItems.RemoveAll(v => v.Value.Equals(keyVal));
         if (SingleItems.ContainsKey(keyVal.Key))
         {
             SingleItems.Remove(keyVal.Key);
         }
         else if (RepeatedItems.ContainsKey(keyVal.Key))
         {
             RepeatedItems[keyVal.Key].RemoveAll(v => v.Equals(keyVal));
             if (!RepeatedItems[keyVal.Key].Any())
             {
                 RepeatedItems.Remove(keyVal.Key);
             }
         }
     }
 }
示例#3
0
 public void RemoveSelected()
 {
     AllItems.RemoveAll(item => SelectedItems.Contains(item));
     SelectedItems.Clear();
 }