Пример #1
0
 protected virtual void OnOpenGroupConfig(GroupEventArgs e)
 {
     if (OpenGroupConfigEvent != null)
     {
         OpenGroupConfigEvent(this, e);
     }
 }
Пример #2
0
 protected virtual void OnGroupNodeSelected(GroupEventArgs e)
 {
     if (GroupNodeSelectedEvent != null)
     {
         GroupNodeSelectedEvent(this, e);
     }
 }
Пример #3
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);
     }
 }
Пример #4
0
 void accountTree_OpenGroupConfigEvent(object sender, GroupEventArgs e)
 {
     try
     {
         //get the top form
         MainForm mainform = this.TopLevelControl as MainForm;
         if (mainform != null)
             mainform.OpenGroupConfigFile(e.Group);
     }
     catch (Exception ex)
     {
         Program.ShowMessageBox("FrmAccountManager", ex);
     }
 }
Пример #5
0
 private void OnOpenGroupConfigClick(object sender, EventArgs e)
 {
     try
     {
         GroupNode gn = this.SelectedNode as GroupNode;
         if (gn != null)
         {
             GroupEventArgs ge = new GroupEventArgs();
             ge.Group = gn.GroupName;
             OnOpenGroupConfig(ge);
         }
     }
     catch (Exception ex)
     {
         ErrorHandler.ShowMessageBox(TreeConstants.EXCEPTION_MODULE, ex);
     }
 }
Пример #6
0
 protected virtual void OnGroupNodeSelected(GroupEventArgs e)
 {
     if (GroupNodeSelectedEvent != null)
         GroupNodeSelectedEvent(this, e);
 }
Пример #7
0
 private void OnOpenGroupConfigClick(object sender, EventArgs e)
 {
     try
     {
         GroupNode gn = this.SelectedNode as GroupNode;
         if (gn != null)
         {
             GroupEventArgs ge = new GroupEventArgs();
             ge.Group = gn.GroupName;
             OnOpenGroupConfig(ge);
         }                
     }
     catch (Exception ex)
     {
         ErrorHandler.ShowMessageBox(TreeConstants.EXCEPTION_MODULE, ex);
     }
 }
Пример #8
0
 protected virtual void OnOpenGroupConfig(GroupEventArgs e)
 {
     if (OpenGroupConfigEvent != null)
         OpenGroupConfigEvent(this, e);
 }
Пример #9
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);
     }
 }
Пример #10
0
        void accountTree_GroupNodeSelectedEvent(object sender, GroupEventArgs e)
        {
            try
            {
                //get the top form
                MainForm mainform = this.TopLevelControl as MainForm;
                if (mainform != null)
                    mainform.AccountGroupNodeSelected(e.Accounts, e.Group);

            }
            catch (Exception ex)
            {
                Program.ShowMessageBox("FrmAccountManager", ex);
            }
        }