Ejemplo n.º 1
0
        public ILaptop CreateLaptop(string model)
        {
            var laptop = new SamsungLaptop {
                Model = model
            };

            laptop.Create();
            return(laptop);
        }
Ejemplo n.º 2
0
        public DecoratorViewModel()
        {
            Widget widget = new ConcreteSamsung();

            widget = new SamsungLaptop(widget);
            widget = new SamsungTab2(widget);

            this.WidgetDescription = widget.GetDescription();
            this.WidgetCost        = string.Format("{0:C}", widget.GetCost());
        }