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); }
public void Remove(AccountComposite account) { this._accounts.Remove(account); }
public void Add(AccountComposite account) { this._accounts.Add(account); }