예제 #1
0
        public void Add(params string[] translations)
        {
            bool isComplete = true;

            for (int i = 0; i < Languages.Length && isComplete; i++)
            {
                if (translations[i] == "")
                {
                    isComplete = false;
                }
            }
            if (isComplete)
            {
                if (Array.Exists(translations, t => t.Contains(WordSeparator[0].ToString())))
                {
                    throw new InvalidDataException($"'{WordSeparator[0]}' is not an allowed character.");
                }
                else
                {
                    ListOfWords.Add(new Word(translations));
                }
            }
            else
            {
                throw new ArgumentException($"The word '{translations[0]}' was not added since it wasn't translated to all languages.");
            }
        }
예제 #2
0
 public void CreateDictionary(List <MedicalService> BillItemList)
 {
     foreach (MedicalService BI in BillItemList)
     {
         ListOfWords.Add(BI.Name);
     }
 }