Example #1
0
        public void AddFriends(AddFriendsInfo addfriends)
        {
            base.Proxy = ConfigCtrl.GetProxy();
            base.Delay = ConfigCtrl.GetDelay();
            base.Initial();

            this._addFriends = addfriends;

            _threadMain = new Thread(new System.Threading.ThreadStart(RunAddFriend));
            _threadMain.IsBackground = true;
            _threadMain.Start();
        }
Example #2
0
        public void AddFriends(AddFriendsInfo addfriends)
        {
            base.Proxy = ConfigCtrl.GetProxy();
            base.Delay = ConfigCtrl.GetDelay();
            base.Initial();

            this._addFriends = addfriends;

            _threadMain = new Thread(new System.Threading.ThreadStart(RunAddFriend));
            _threadMain.IsBackground = true;
            _threadMain.Start();
        }
Example #3
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            try
            {
                if (lstNewAccounts.Items.Count <= 0)
                {
                    MessageBox.Show("请至少选择一个账号!", MainConstants.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    lstNewAccounts.Select();
                    return;
                }
                if (!rdbAuto.Checked && lstOldAccounts.Items.Count<=0)
                {
                    MessageBox.Show("请至少选择一个旧账号!", MainConstants.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    lstOldAccounts.Select();
                    return;
                }

                if (!chkExecuteSendRequest.Checked && !chkExecuteConfirmRequest.Checked)
                {
                    MessageBox.Show("请至少选择一个操作!", MainConstants.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    chkExecuteSendRequest.Select();
                    return;
                }

                //accounts
                Collection<AccountInfo> newaccounts = new Collection<AccountInfo>();
                foreach (object item in lstNewAccounts.Items)
                {
                    AccountInfo user = item as AccountInfo;
                    if (user != null)
                    {
                        newaccounts.Add(user);
                    }
                }

                Collection<AccountInfo> oldaccounts = new Collection<AccountInfo>();
                foreach (object item in lstOldAccounts.Items)
                {
                    AccountInfo user = item as AccountInfo;
                    if (user != null)
                    {
                        oldaccounts.Add(user);
                    }
                }

                SetControlStatus(false);

                AddFriendsInfo addfriends = new AddFriendsInfo();
                addfriends.AddMode = rdbAuto.Checked;
                addfriends.DeleteAllMessages = chkDeleteAllMessage.Checked;
                addfriends.ExecuteSendRequest = chkExecuteSendRequest.Checked;
                addfriends.ExecuteConfirmRequest = chkExecuteConfirmRequest.Checked;
                addfriends.NewAccountsList = newaccounts;
                addfriends.OldAccountsList = oldaccounts;
                addfriends.Accounts = newaccounts;

                _tooladdfriends.AddFriends(addfriends);


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