Пример #1
0
 public static void EnsureOnSetIfContained <T>(this MyIterableComplementSet <T> self, T item)
 {
     if (self.Contains(item) && self.IsInComplement(item))
     {
         self.MoveToSet(item);
     }
 }
Пример #2
0
 public static void RemoveIfContained <T>(this MyIterableComplementSet <T> self, T item)
 {
     if (self.Contains(item))
     {
         self.Remove(item);
     }
 }
Пример #3
0
 public static void AddOrEnsureOnSet <T>(this MyIterableComplementSet <T> self, T item)
 {
     if (!self.Contains(item))
     {
         self.Add(item);
     }
     else if (self.IsInComplement(item))
     {
         self.MoveToSet(item);
     }
 }