示例#1
0
 public ConcreteMediator(Tab_1 tab_1, Tab_2 tab_2)
 {
     this._tab_1 = tab_1;
     this._tab_1.SetMediator(this);
     this._tab_2 = tab_2;
     this._tab_2.SetMediator(this);
 }
示例#2
0
        static void Main(string[] args)
        {
            // The Customer code.
            Tab_1 tab_1 = new Tab_1();
            Tab_2 tab_2 = new Tab_2();

            new ConcreteMediator(tab_1, tab_2);

            Console.WriteLine("Customer triggers New Deposit.");
            tab_1.DoDeposit();

            Console.WriteLine();

            Console.WriteLine("Customer triggers New Withdraw.");
            tab_2.DemandDraft();
        }