public void RemoveName(string word)
        {
            if (word == null || word.Length <= 1 || !_namesEtcList.Contains(word))
            {
                return;
            }

            _namesEtcList.Remove(word);
            _namesEtcListUppercase.Remove(word.ToUpper());
            if (_languageName.StartsWith("en_", StringComparison.Ordinal) && !word.EndsWith('s'))
            {
                _namesEtcList.Remove(word + "s");
                _namesEtcListUppercase.Remove(word.ToUpper() + "S");
            }
            if (!word.EndsWith('s'))
            {
                _namesEtcListWithApostrophe.Remove(word + "'s");
                _namesEtcListUppercase.Remove(word.ToUpper() + "'S");
            }
            if (!word.EndsWith('\''))
            {
                _namesEtcListWithApostrophe.Remove(word + "'");
            }

            _namesList.Remove(word);
        }
Example #2
0
 private void OnRemove()
 {
     if (SelectedName != null)
     {
         NamesList.Remove(SelectedName);
         SelectedName = null;
     }
 }
Example #3
0
        public void NamesListRemove()
        {
            // Arrange
            var namesList = new NamesList(Directory.GetCurrentDirectory(), "en", false, null);

            namesList.Add("Jones123");

            // Act
            namesList.Remove("Jones123");

            // Assert
            Assert.IsFalse(namesList.GetNames().Contains("Jones123"));
        }
 public void Remove(string name)
 {
     NamesList.Remove(name);
 }