Ejemplo n.º 1
0
 public void PlayLumia(Lumia phone)
 {
     Console.WriteLine("这里是{0}", this.Name);
     phone.Call();
     phone.Text();
     //phone.New();
 }
Ejemplo n.º 2
0
        public static void Show()
        {
            // DIPShow -- 高层
            // Student -- 上层
            // Phone -- 低层

            Student student = new Student()
            {
                Id   = 1,
                Name = "Ivan"
            };


            {
                Iphone phone = new Iphone();

                // student.PlayIphone(phone);
                student.Play(phone);
            }

            {
                Lumia phone = new Lumia();
                // student.PlayLumia(phone);
                student.Play(phone);
            }
        }
Ejemplo n.º 3
0
 public static void Show()
 {
     Console.WriteLine("*****************************");
     Student student = new Student()
     {
         Id   = 191,
         Name = "候鸟"
     };
     {
         iPhone phone = new iPhone();
         student.PlayiPhone(phone);
         student.PlayPhone(phone);
     }
     {
         Lumia phone = new Lumia();
         student.PlayLumia(phone);
         student.PlayPhone(phone);
     }
     {
         Honor phone = new Honor();
         student.PlayHonor(phone);
         student.PlayPhone(phone);
     }
     {
         Mi phone = new Mi();
         //student.PlayHonor(phone);
         student.PlayPhone(phone);
     }
 }