public void Constructor(ICellPhone celularBuilder)
 {
     celularBuilder.BuildBattery();
     celularBuilder.BuildCamera();
     celularBuilder.BuildOperationalSystem();
     celularBuilder.BuildScreen();
 }
예제 #2
0
        static void Main(string[] args)
        {
            CellPhone_Store store = new Concrete_Cellphone_Store();

            ICellPhone iphone10 = store.GetCellPhone("Iphone X");

            iphone10.sell_phone("mauricio", 9353864, 1000);

            ICellPhone samsung = store.GetCellPhone("Samsung S10");

            samsung.sell_phone("andres", 3027905, 900);

            Console.ReadKey();
        }
예제 #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Phi Long Technology!");
            Console.ReadLine();

            Console.WriteLine("This is a High-end smartphone of Samsung Factory");
            ICellPhoneFactory cellPhoneFactory = new SamsungFactory();
            ICellPhone        samsung          = cellPhoneFactory.GetHighEnd();
            IColor            color            = samsung.GetColor();
            IBattery          battery          = samsung.GetBattery();
            IQuickCharge      quickcharge      = samsung.GetQuickCharge();

            Console.WriteLine(color.GetColorType());
            Console.WriteLine(battery.GetBatteryType());
            Console.WriteLine(quickcharge.GetQuickChargeType());
            Console.ReadLine();

            Console.WriteLine("------------------------------------------");
            Console.ReadLine();

            Console.WriteLine("This is a Mid-range smartphone of Oppo Factory");
            ICellPhoneFactory cellPhoneFactory2 = new OppoFactory();
            ICellPhone        oppo         = cellPhoneFactory.GetMidRange();
            IColor            color2       = oppo.GetColor();
            IBattery          battery2     = oppo.GetBattery();
            IQuickCharge      quickcharge2 = oppo.GetQuickCharge();

            Console.WriteLine(color2.GetColorType());
            Console.WriteLine(battery2.GetBatteryType());
            Console.WriteLine(quickcharge2.GetQuickChargeType());
            Console.ReadLine();

            Console.WriteLine("------------------------------------------");
            Console.ReadLine();

            Console.WriteLine("This is a Lower-end smartphone of IPhone Factory");
            ICellPhoneFactory cellPhoneFactory3 = new IPhoneFactory();
            ICellPhone        iphone            = cellPhoneFactory.GetLowerEnd();
            IColor            color3            = iphone.GetColor();
            IBattery          battery3          = iphone.GetBattery();
            IQuickCharge      quickcharge3      = iphone.GetQuickCharge();

            Console.WriteLine(color3.GetColorType());
            Console.WriteLine(battery3.GetBatteryType());
            Console.WriteLine(quickcharge3.GetQuickChargeType());
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Builder!");

            // Create Manufacturer
            Manufacturer manufacturer = new Manufacturer();

            // Allows the Builder class to be ready
            ICellPhone celluarBuild = null;

            // Let's create a Android cellphone
            celluarBuild = new IPhoneBuilder(); //AndroidBuilder();
            manufacturer.Constructor(celluarBuild);
            Console.WriteLine("A new cell phone was built by: {0}", celluarBuild.CellPhone.Name);
            Console.WriteLine("Camera: {0}", celluarBuild.CellPhone.Camera);
            Console.WriteLine("OS: {0}", celluarBuild.CellPhone.OperationaSystem);
            Console.WriteLine("Screen: {0}", celluarBuild.CellPhone.Screen);
            Console.WriteLine("Batrery: {0}", celluarBuild.CellPhone.Battery);

            Console.ReadKey();
        }
 public OfferPrice(ICellPhone cellphone) : base(cellphone)
 {
 }
 public CellPhoneDecorator(ICellPhone CellPhone)
 {
     cellphone = CellPhone;
 }