Beispiel #1
0
 private static void AddRecords(string[] input, PhoneRecords records)
 {
     for (int i = 0; i < input.Length; i++)
     {
         var nextRecord = new PhoneRecord(input[i]);
         records.Add(nextRecord);
     }
 }
        public void Add(PhoneRecord record)
        {
            string[] nameTownNumber = record.Record.Split(new char[] { SeparatorField }, StringSplitOptions.RemoveEmptyEntries);
            this.recordsByTown.Add(nameTownNumber[1].Trim(), record);

            string[] firstMiddleLastNickName = nameTownNumber[0].Split(new char[] { SeparatorNames }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < firstMiddleLastNickName.Length; i++)
            {
                this.recordsByName.Add(firstMiddleLastNickName[i].Trim(), record);
            }
        }