예제 #1
0
        static void Main(string[] args)
        {
            IPhone iphone8 = new IPhone("iPhone 8", 80, "T-Mobile", "Bring a ding ring ring");

            Console.WriteLine(iphone8.Ring());
            Console.WriteLine(iphone8.Snap());
            Console.WriteLine(iphone8.Unlock());
            Console.WriteLine(iphone8.Ring());
            Console.WriteLine(iphone8.Ring());
            Console.WriteLine(iphone8.Ring());
            Console.WriteLine(iphone8.Ring());
            Console.WriteLine(iphone8.Ring());
            Console.WriteLine(iphone8.Ring());
            Console.WriteLine(iphone8.Ring());

            Console.WriteLine(iphone8.BatteryPercentage);
            Console.WriteLine(iphone8.Charge());
            Console.WriteLine(iphone8.Charge());
            Console.WriteLine(iphone8.Charge());
            Console.WriteLine(iphone8.Charge());
            Console.WriteLine(iphone8.Charge());
            Console.WriteLine(iphone8.Charge());
            Console.WriteLine(iphone8.Charge());
            Console.WriteLine(iphone8.Charge());
            Console.WriteLine(iphone8.Charge());
            Console.WriteLine(iphone8.Charge());
            Console.WriteLine(iphone8.Charge());
            Console.WriteLine(iphone8.Charge());
            Phone            Samsung = new Phone("Galaxy 9", 100, "AT&T", "BEEEEEEEEAAP");
            List <IRingable> rings   = new List <IRingable>();

            rings.Add(iphone8);
        }
 public virtual void Charge()
 {
     _wrappedPhone.Charge();
 }
예제 #3
0
 public void Charge(IPhone iphone)
 {
     iphone.Charge();
 }