コード例 #1
0
ファイル: Program.cs プロジェクト: urb31075/ProgramTemplate
        /// <summary>
        /// The main.
        /// </summary>
        private static void Main()
        {
            var commandSender = new CommandSender();

            var deviceA = new DeviceA();

            commandSender.Push(new DeviceAdapterA(deviceA));
            commandSender.Push(new DeviceAdapterInterfaceA(deviceA));

            var deviceB = new DeviceB();

            commandSender.Push(new DeviceAdapterB(deviceB));
            commandSender.Push(new DeviceAdapterInterfaceB(deviceB));

            var deviceC = new DeviceC();

            commandSender.Push(new DeviceAdapterC(deviceC));
            commandSender.Push(new DeviceAdapterInterfaceC(deviceC));

            Console.ReadLine();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: urb31075/ProgramTemplate
 public DeviceAdapterA(DeviceA device)
 {
     this.device = device;
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: urb31075/ProgramTemplate
 public DeviceAdapterInterfaceA(DeviceA device)
 {
     this.device = device;
 }