Exemplo n.º 1
0
        void accountTree_OpenOperationConfigEvent(object sender, AccountEventArgs e)
        {
            try
            {
                //get the top form
                MainForm mainform = this.TopLevelControl as MainForm;
                if (mainform != null)
                    mainform.OpenOperationConfigFile(e.Group, e.Account);

            }
            catch (Exception ex)
            {
                Program.ShowMessageBox("FrmAccountManager", ex);
            }
        }
Exemplo n.º 2
0
 private void accountTree_AccountNodeSelectedEvent(object sender, Johnny.Kaixin.Controls.AccountTree.AccountEventArgs e)
 {
     try
     {
         //get the top form
         MainForm mainform = this.TopLevelControl as MainForm;
         if (mainform != null)
         {
             mainform.AccountNodeSelected(e.Account);
         }
     }
     catch (Exception ex)
     {
         Program.ShowMessageBox("FrmAccountManager", ex);
     }
 }
Exemplo n.º 3
0
 void accountTree_OpenUserEvent(object sender, Johnny.Kaixin.Controls.AccountTree.AccountEventArgs e)
 {
     try
     {
         //get the top form
         MainForm mainform = this.TopLevelControl as MainForm;
         if (mainform != null)
         {
             mainform.ShowUserDetail(e.Group, e.Account);
         }
     }
     catch (Exception ex)
     {
         Program.ShowMessageBox("FrmAccountManager", ex);
     }
 }
Exemplo n.º 4
0
 protected virtual void OnAccountNodeSelected(AccountEventArgs e)
 {
     if (AccountNodeSelectedEvent != null)
         AccountNodeSelectedEvent(this, e);
 }
Exemplo n.º 5
0
 protected virtual void OnOpenInBrowser(AccountEventArgs e)
 {
     if (OpenInBrowserEvent != null)
         OpenInBrowserEvent(this, e);
 }
Exemplo n.º 6
0
 protected virtual void OnOpenOperationConfig(AccountEventArgs e)
 {
     if (OpenOperationConfigEvent != null)
         OpenOperationConfigEvent(this, e);
 }
Exemplo n.º 7
0
 private void OnOpenInBrowserClick(object sender, EventArgs e)
 {
     try
     {                
         AccountNode un = this.SelectedNode as AccountNode;
         if (un != null)
         {
             AccountEventArgs te = new AccountEventArgs();
             te.Account = un.Account;
             OnOpenInBrowser(te);
         }
     }
     catch (Exception ex)
     {
         ErrorHandler.ShowMessageBox(TreeConstants.EXCEPTION_MODULE, ex);
     }
 }
Exemplo n.º 8
0
 private void OnOpenOperationConfigClick(object sender, EventArgs e)
 {
     try
     {               
         AccountNode an = this.SelectedNode as AccountNode;
         if (an != null)
         {
             AccountEventArgs te = new AccountEventArgs();
             GroupNode gn = an.Parent as GroupNode;
             te.Group = gn.GroupName;
             te.Account = an.Account;
             OnOpenOperationConfig(te);
         }
     }
     catch (Exception ex)
     {
         ErrorHandler.ShowMessageBox(TreeConstants.EXCEPTION_MODULE, ex);
     }
 }        
Exemplo n.º 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);
     }
 }