コード例 #1
0
ファイル: Program.cs プロジェクト: pedrohma/design-patterns
        static void Main(string[] args)
        {
            SendData data = new SendEmail();

            data.components = new WebService();
            data.Send();

            data.components = new ThirdPartyAPI();
            data.Send();

            data = new SendSMS();

            data.components = new WebService();
            data.Send();

            data.components = new ThirdPartyAPI();
            data.Send();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            SendData sendData = new SendEmail();

            sendData.BridgeComponents = new WebService();
            sendData.Send();

            sendData.BridgeComponents = new ThirdPartyAPI();
            sendData.Send();

            sendData = new SendSMS();

            sendData.BridgeComponents = new WebService();
            sendData.Send();

            sendData.BridgeComponents = new ThirdPartyAPI();
            sendData.Send();

            Console.ReadLine();
        }