private static PhoneEntry CreateEntry(string[] entryData, string[] names) { PhoneEntry phoneEntry; if (names.Length == 3) { phoneEntry = new PhoneEntry(names[0].Trim(), entryData[1].Trim(), entryData[2].Trim(), names[2].Trim(), names[1].Trim()); } else if (names.Length == 2) { phoneEntry = new PhoneEntry(names[0].Trim(), entryData[1].Trim(), entryData[2].Trim(), names[1].Trim()); } else { phoneEntry = new PhoneEntry(names[0].Trim(), entryData[1].Trim(), entryData[2].Trim()); } return(phoneEntry); }
private static void CreateEntry(List <PhoneEntry> phoneEntries, string[] entryData, string[] names) { if (names.Length == 3) { PhoneEntry phoneEntry = new PhoneEntry(names[0].Trim(), entryData[1].Trim(), entryData[2].Trim(), names[2].Trim(), names[1].Trim()); phoneEntries.Add(phoneEntry); } else if (names.Length == 2) { PhoneEntry phoneEntry = new PhoneEntry(names[0].Trim(), entryData[1].Trim(), entryData[2].Trim(), names[1].Trim()); phoneEntries.Add(phoneEntry); } else { PhoneEntry phoneEntry = new PhoneEntry(names[0].Trim(), entryData[1].Trim(), entryData[2].Trim()); phoneEntries.Add(phoneEntry); } }
private static void CreateEntry(List<PhoneEntry> phoneEntries, string[] entryData, string[] names) { if (names.Length == 3) { PhoneEntry phoneEntry = new PhoneEntry(names[0].Trim(), entryData[1].Trim(), entryData[2].Trim(), names[2].Trim(), names[1].Trim()); phoneEntries.Add(phoneEntry); } else if (names.Length == 2) { PhoneEntry phoneEntry = new PhoneEntry(names[0].Trim(), entryData[1].Trim(), entryData[2].Trim(), names[1].Trim()); phoneEntries.Add(phoneEntry); } else { PhoneEntry phoneEntry = new PhoneEntry(names[0].Trim(), entryData[1].Trim(), entryData[2].Trim()); phoneEntries.Add(phoneEntry); } }