Beispiel #1
0
 private void cmbGroup_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cmbGroup.Items.Count > 0 && cmbGroup.Text != string.Empty)
     {
         _accounts = ConfigCtrl.GetAccounts(cmbGroup.Text);
         listBoxSelectorAccounts.Clear();
         listBoxSelectorAccounts.AllItems = _accounts;
     }
 }
Beispiel #2
0
        public void InitialNodes()
        {
            //set images
            imageListIcon.ColorDepth = ColorDepth.Depth32Bit;//不然图片会失真,周围会有黑线
            imageListIcon.Images.Add(IconCtrl.GetIconFromResx(TreeConstants.ICON_USERS));
            imageListIcon.Images.Add(IconCtrl.GetIconFromResx(TreeConstants.ICON_USER));
            imageListIcon.Images.Add(IconCtrl.GetIconFromResx(TreeConstants.ICON_ADDUSER));
            imageListIcon.Images.Add(IconCtrl.GetIconFromResx(TreeConstants.ICON_KEYS));
            imageListIcon.Images.Add(IconCtrl.GetIconFromResx(TreeConstants.ICON_DELETE));
            imageListIcon.Images.Add(IconCtrl.GetIconFromResx(TreeConstants.ICON_WEBBROWSER));
            imageListIcon.Images.Add(IconCtrl.GetIconFromResx(TreeConstants.ICON_OPERATIONCONFIG));
            imageListIcon.Images.Add(ImageCtrl.GetIconFromResx(TreeConstants.IMAGE_REFRESH));
            imageListIcon.Images.Add(IconCtrl.GetIconFromResx(TreeConstants.ICON_ROOT));
            imageListIcon.Images.Add(IconCtrl.GetIconFromResx(TreeConstants.ICON_XML));

            this.ImageList = imageListIcon;

            //set nodes
            base.Nodes.Clear();

            //build Root node
            BaseNode Root = new BaseNode("所有帐号");

            base.Nodes.Add(Root);

            //build Groups node
            string[] groups = ConfigCtrl.GetGroups();
            foreach (string group in groups)
            {
                GroupNode gn = new GroupNode(group);
                Root.Nodes.Add(gn);

                //build Accounts node
                Collection <AccountInfo> accounts = ConfigCtrl.GetAccounts(group);
                if (accounts != null)
                {
                    gn.Text = gn.Text + "(" + accounts.Count + ")";
                    foreach (AccountInfo account in accounts)
                    {
                        AccountNode sn = new AccountNode(account);
                        gn.Nodes.Add(sn);
                    }
                }
            }

            if (Root.Nodes.Count > 0)
            {
                Root.Expand();
            }
        }
Beispiel #3
0
        private void BuildListAccount(string group)
        {
            Collection <AccountInfo> accounts = ConfigCtrl.GetAccounts(group);

            if (accounts != null)
            {
                lstAllNewAccounts.Items.Clear();
                lstAllOldAccounts.Items.Clear();

                foreach (AccountInfo user in accounts)
                {
                    lstAllNewAccounts.Items.Add(user);
                    lstAllOldAccounts.Items.Add(user);
                }
            }
        }
Beispiel #4
0
 private void cmbGroup_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (cmbGroup.Items.Count > 0 && cmbGroup.Text != string.Empty)
         {
             _accounts = ConfigCtrl.GetAccounts(cmbGroup.Text);
             listBoxSelectorAccounts.Clear();
             listBoxSelectorAccounts.AllItems = _accounts;
         }
     }
     catch (Exception ex)
     {
         Program.ShowMessageBox("FrmMaintainContact", ex);
     }
 }
Beispiel #5
0
        private void BuildCmbAccount(string group)
        {
            Collection <AccountInfo> accounts = ConfigCtrl.GetAccounts(group);

            if (accounts != null)
            {
                cmbSender.Items.Clear();
                foreach (AccountInfo account in accounts)
                {
                    cmbSender.Items.Add(account);
                }
            }

            lstAllAccounts.Items.Clear();
            lstSelectedAccounts.Items.Clear();
        }
Beispiel #6
0
        private void BuildCmbAccount(string group)
        {
            //所有的账号
            Collection <AccountInfo> accounts = ConfigCtrl.GetAccounts(group);

            if (accounts != null)
            {
                cmbAccount.Items.Clear();
                foreach (AccountInfo account in accounts)
                {
                    cmbAccount.Items.Add(account);
                }
                if (cmbAccount.Items.Count > 0)
                {
                    cmbAccount.SelectedIndex = 0;
                }
            }
        }
Beispiel #7
0
        private void btnCarsInMarket_Click(object sender, EventArgs e)
        {
            try
            {
                _toolbuildteam = new ToolBuildTeam((AccountInfo)cmbAccount.SelectedItem);
                _toolbuildteam.MessageChanged         += new KaixinBase.MessageChangedEventHandler(_toolbuildteam_MessageChanged);
                _toolbuildteam.ValidateCodeNeeded     += new KaixinBase.ValidateCodeNeededEventHandler(_toolbuildteam_ValidateCodeNeeded);
                _toolbuildteam.AllCarsInMarketFetched += new GamePark.AllCarsInMarketFetchedEventHandler(_toolbuildteam_AllCarsInMarketFetched);

                if (cmbAccount.SelectedIndex >= 0)
                {
                    _account = cmbAccount.Items[cmbAccount.SelectedIndex] as AccountInfo;
                }
                else
                {
                    Collection <AccountInfo> accounts = ConfigCtrl.GetAccounts("");
                    if (accounts == null || accounts.Count == 0)
                    {
                        MessageBox.Show("没有有效的账号,无法刷新!", MainConstants.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        cmbAccount.Select();
                        return;
                    }
                    if (accounts[0] == null)
                    {
                        MessageBox.Show("没有有效的账号,无法刷新!", MainConstants.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        cmbAccount.Select();
                        return;
                    }

                    _account = accounts[0];
                }

                SetControlStatus(false);

                _toolbuildteam.GetAllCarsInMarketByThread();
            }
            catch (Exception ex)
            {
                Program.ShowMessageBox("FrmBuildTeam", ex);
            }
        }