예제 #1
0
        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);
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
            }
        }