Пример #1
0
        public void Remove(object value)
        {
            MySortedDictionary <K, T> ms = new MySortedDictionary <K, T>(sl);
            int index = ms.IndexOfValue(value);
            K   key   = ms.GetKey(index);

            sl.Remove(key);
        }
Пример #2
0
 public void SetByIndex(int index, object value)
 {
     if (index > Count - 1)
     {
         Console.WriteLine();
         Console.WriteLine("Ключа с таким индексом нет в словаре", Console.ForegroundColor = ConsoleColor.Red);
         Console.ResetColor();
     }
     else
     {
         MySortedDictionary <K, T> ms = new MySortedDictionary <K, T>(sl);
         K key = ms.GetKey(index);
         sl.RemoveAt(index);
         sl.Add(key, (T)value);
     }
 }