public void RemoveReplacement(KeyReplacement key) { if (!replacements.Contains(key)) { throw new Exception($"Replacement \"{key.ToString()}\" not found"); } replacements.Remove(key); statistics.Remove(key); }
public void AddReplacement(KeyReplacement key) { if (replacements.Any(x => x.Equals(key))) { throw new Exception($"Replacement \"{key.ToString()}\" already exists"); } replacements.Add(key); statistics.Add(key, new KeyStatistics()); }