Exemplo n.º 1
0
        public void ClientCode(DatingServiceControl control)
        {
            // Enable profile
            Console.WriteLine(control.ToggleProfile());
            var profile = "姓名: 單身狗, 年齡: 26, 性別: 男, 職業: 工程師, 配對性別: 女, 配對年齡: 18-35";

            Console.WriteLine(control.SetProfile(profile));
            if (control is VIPDatingServiceControl)
            {
                Console.WriteLine((control as VIPDatingServiceControl).SetAdvancedMatchLocation("內湖"));
            }
            else
            {
                Console.WriteLine(control.SetMatchLocation("內湖"));
            };
            // Disable profile
            Console.WriteLine(control.ToggleProfile());
            Console.WriteLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Client client = new Client();

            DatingServiceControl control;

            Console.WriteLine("[ 使用交友軟體標準版 ]");
            control = new DatingServiceControl(new DatingApp());
            client.ClientCode(control);

            Console.WriteLine("[ 使用相親標準版 ]");
            control = new DatingServiceControl(new BlindDateService());
            client.ClientCode(control);

            Console.WriteLine("[ 使用交友軟體 VIP 版 ]");
            control = new VIPDatingServiceControl(new DatingApp());
            client.ClientCode(control);

            Console.WriteLine("[ 使用交友軟體 VIP 版 ]");
            control = new VIPDatingServiceControl(new BlindDateService());
            client.ClientCode(control);
        }