コード例 #1
0
        public static void RunExample()
        {
            AccountComposite accountRoot  = new AccountComposite("Brian");
            AccountComposite accountTree1 = new AccountComposite("Diana");
            AccountComposite accountTree2 = new AccountComposite("Mark");
            AccountComposite accountLeaf1 = new AccountComposite("This");
            AccountComposite accountLeaf2 = new AccountComposite("Is");
            AccountComposite accountLeaf3 = new AccountComposite("It");

            accountRoot.Add(accountTree1);
            accountRoot.Add(accountTree2);

            accountTree2.Add(accountLeaf1);
            accountTree2.Add(accountLeaf2);
            accountTree2.Add(accountLeaf3);


            accountRoot.Notify(1);
        }
コード例 #2
0
 public void Remove(AccountComposite account)
 {
     this._accounts.Remove(account);
 }
コード例 #3
0
 public void Add(AccountComposite account)
 {
     this._accounts.Add(account);
 }