Пример #1
0
 protected virtual void OnRootNodeSelected(RootNodeEventArgs e)
 {
     if (RootNodeSelectedEvent != null)
     {
         RootNodeSelectedEvent(this, e);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 private void accountTree_RootNodeSelectedEvent(object sender, Johnny.Kaixin.Controls.AccountTree.RootNodeEventArgs e)
 {
     try
     {
         //get the top form
         MainForm mainform = this.TopLevelControl as MainForm;
         if (mainform != null)
         {
             mainform.AccountRootNodeSelected(e.Groups);
         }
     }
     catch (Exception ex)
     {
         Program.ShowMessageBox("FrmAccountManager", ex);
     }
 }
Пример #4
0
 protected virtual void OnRootNodeSelected(RootNodeEventArgs e)
 {
     if (RootNodeSelectedEvent != null)
         RootNodeSelectedEvent(this, e);
 }
Пример #5
0
 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);
     }
 }