コード例 #1
0
ファイル: Program.cs プロジェクト: b-hailu/My-First-App
        public static void LEDTVModel()
        {
            LEDTV led = new LEDTV(50, 2500.50F, 2, true, "Remote");

            led.Size      = 50;
            led.Price     = 2500.50F;
            led.Ports     = 2;
            led.Mountable = true;
            led.Remote    = "Physical Remote and Smart App";
            led.TVModel();
            Console.WriteLine("the size is {0} inch\n the price is ${1}\n has {2} ports\nis mountable- {3}\n and also {4}", led.Size, led.Price, led.Ports, led.Mountable, led.Remote);
        }
コード例 #2
0
 public SamsungRemoteControl(LEDTV ledTv) : base(ledTv)
 {
 }
コード例 #3
0
 protected AbstractRemoteControl(LEDTV ledTv)
 {
     this.ledTv = ledTv;
 }
コード例 #4
0
 public SonyRemoteControl(LEDTV ledTv) : base(ledTv)
 {
 }
コード例 #5
0
ファイル: Originator.cs プロジェクト: mokarchi/DesignPatterns
 public void SetMemento(Memento memento)
 {
     ledTV = memento.ledTV;
 }
コード例 #6
0
 public Memento(LEDTV ledTV)
 {
     this.ledTV = ledTV;
 }
コード例 #7
0
ファイル: Program.cs プロジェクト: watchbot23/GDM.UIP.HW
        static void Main(string[] args)
        {
            List <Electronics>       listOfElectronicDevices = new List <Electronics>();
            LinkedList <Electronics> listOfDevicesInNetWork  = new LinkedList <Electronics>();
            LapTop acer = new LapTop("Acer", 500, 8, 2.1);

            listOfElectronicDevices.Add(acer);
            LapTop msi = new LapTop("MSI", 650, 16, 2.9);

            listOfElectronicDevices.Add(msi);
            Console.WriteLine(acer.laptop + " 1:\n" + acer.ToString());
            Console.WriteLine(msi.laptop + " 2:\n" + msi.ToString());

            Server intel = new Server("Intel", 200, 120, 8);

            listOfElectronicDevices.Add(intel);
            Server amd = new Server("AMD", 300, 140, 12);

            listOfElectronicDevices.Add(amd);
            Console.WriteLine(intel.server + " 1:\n" + intel.ToString());
            Console.WriteLine(amd.server + " 2:\n" + amd.ToString());

            PlasmTV samsung = new PlasmTV("Samsung", 300, 32, "1920x1080");

            listOfElectronicDevices.Add(samsung);
            PlasmTV lg = new PlasmTV("LG", 500, 50, "3840x2160");

            listOfElectronicDevices.Add(lg);
            Console.WriteLine(samsung.plazmTV + " 1:\n" + samsung.ToString());
            Console.WriteLine(lg.plazmTV + " 2:\n" + lg.ToString());

            LEDTV sharp = new LEDTV("Sharp", 350, 40, 60);

            listOfElectronicDevices.Add(sharp);
            LEDTV xiaomi = new LEDTV("Xiaomi", 700, 65, 75);

            listOfElectronicDevices.Add(xiaomi);
            Console.WriteLine(sharp.ledTV + " 1:\n" + sharp.ToString());
            Console.WriteLine(xiaomi.ledTV + " 2:\n" + xiaomi.ToString());

            PlayerDevice sony = new PlayerDevice("Sony", 350, "MP3, AVC");

            listOfElectronicDevices.Add(sony);
            PlayerDevice panasonic = new PlayerDevice("Panasonic", 700, "MP3, Flac");

            listOfElectronicDevices.Add(panasonic);
            Console.WriteLine(sony.player + " 1:\n" + sony.ToString());
            Console.WriteLine(panasonic.player + " 2:\n" + panasonic.ToString());

            Console.WriteLine(sony.GetGeneralPower());
            Console.WriteLine(acer.GetGeneralMemory());

            Generator generator = new Generator("Generator", 3000);

            Console.WriteLine(generator.GetAvailablePower());
            Console.WriteLine(generator.GetAvailablePower());

            generator.AllDevicesInNetWork(ref listOfDevicesInNetWork);
            MainProgram(listOfElectronicDevices, ref listOfDevicesInNetWork, generator);

            Console.ReadLine();
        }