public void DeletePairByName(string name) { string normalizedName = NormalizeName(name); string value = GetValueByKey(normalizedName); if (value == null) { throw new KeyNotFoundException(); } ContactsList.Remove(normalizedName); OutgoingCallHistory.Remove(FindTuppleByKey(normalizedName)); ChachedHasToChange = true; }
public void AddOutgoingCall(string name) { string normalizedName = NormalizeName(name); Tuple <int, string> current = FindTuppleByKey(normalizedName); if (current == null) { throw new Exception("The key does not exist."); } OutgoingCallHistory.Remove(current); Tuple <int, string> newTupple = new Tuple <int, string>(current.Item1 + 1, current.Item2); OutgoingCallHistory.Add(newTupple); }