protected virtual void OnRootNodeSelected(RootNodeEventArgs e) { if (RootNodeSelectedEvent != null) RootNodeSelectedEvent(this, e); }
private void OnAfterSelect(object sender, TreeViewEventArgs e) { try { if (this.SelectedNode is GroupNode) { GroupNode bn = this.SelectedNode as GroupNode; if (bn != null) { GroupEventArgs ge = new GroupEventArgs(); ge.Group = bn.GroupName; ge.Accounts = new Collection<AccountInfo>(); foreach (AccountNode accountnode in bn.Nodes) { ge.Accounts.Add(accountnode.Account); } OnGroupNodeSelected(ge); } } else if (this.SelectedNode is AccountNode) { AccountNode an = this.SelectedNode as AccountNode; AccountEventArgs ae = new AccountEventArgs(); if (an != null) { ae.Account = an.Account; } else ae.Account = null; OnAccountNodeSelected(ae); } else if (this.SelectedNode is BaseNode) { BaseNode bn = this.SelectedNode as BaseNode; if (bn != null) { RootNodeEventArgs re = new RootNodeEventArgs(); re.Groups = new string[bn.Nodes.Count]; for (int ix = 0; ix < bn.Nodes.Count; ix++) { GroupNode gn = bn.Nodes[ix] as GroupNode; if (gn != null) re.Groups[ix] = gn.GroupName; } OnRootNodeSelected(re); } } } catch (Exception ex) { ErrorHandler.ShowMessageBox(TreeConstants.EXCEPTION_MODULE, ex); } }