コード例 #1
0
        public void RemoveReplacement(KeyReplacement key)
        {
            if (!replacements.Contains(key))
            {
                throw new Exception($"Replacement \"{key.ToString()}\" not found");
            }

            replacements.Remove(key);
            statistics.Remove(key);
        }
コード例 #2
0
        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());
        }