コード例 #1
0
ファイル: Program.cs プロジェクト: samukos/CSharp-OOP
        static void Main(string[] args)
        {
            PhoneBookEntry x = new PhoneBookEntry();

            x.SetFirstName     = "S";
            x.SetLastName      = "K";
            x.SetNumber        = "1234567";
            x.SetStreetAddress = "123 Main Street";
            x.SetPageUrl       = "www.sivu.fi";
            x.SetEmailAddress  = "*****@*****.**";

            PhoneBookEntry y = new PhoneBookEntry();

            y.SetFirstName     = "Sam";
            y.SetLastName      = "Kos";
            y.SetNumber        = "123";
            y.SetStreetAddress = "123 Wall Street";
            y.SetPageUrl       = "www.jep.fi";
            y.SetEmailAddress  = "*****@*****.**";

            PhoneBookApp contactList = new PhoneBookApp();

            contactList.AddContact(x);
            contactList.AddContact(y);
            contactList.DisplayPhoneBook();

            Console.ReadLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            PhoneBookEntry x = new PhoneBookEntry();

            x.SetFirstName     = "Sa";
            x.SetLastName      = "Kos";
            x.SetNumber        = "1234567";
            x.SetStreetAddress = "123 Main Street";
            x.SetPageUrl       = "www.sivu.fi";
            x.SetEmailAddress  = "*****@*****.**";
            x.display();

            Console.ReadLine();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: samukos/CSharp-OOP
 public void AddContact(PhoneBookEntry contact)
 {
     Array.Resize(ref contactList, contactList.Length + 1);
     contactList[contactList.Length - 1] = contact;
 }