public ManageForm(YTAccount account, DataGridViewRow row) : this() { this.account = account; this.row = row; this.textBox1.Text = account.username; this.textBox2.Text = account.password; this.textBox3.Text = account.email; this.textBox4.Text = String.Join(":", account.proxy); this.textBox5.Text = account.phone; this.textBox6.Text = account.surname; }
void AddAccount(YTAccount account) { var actButton = new System.Windows.Forms.DataGridViewButtonCell(); actButton.FlatStyle = FlatStyle.Flat; actButton.Value = "Manage"; actButton.Tag = account.id; dataGridView1.Rows.Add(account.username + ' ' + account.surname, account.email, account.proxy != null?account.proxy[0] + ':' + account.proxy[1]:"", account.status, FilterAgent(account.agent)); dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[5] = actButton; accounts.Add(account); }
public void SetStatusFor(YTAccount acc) { this.Invoke((MethodInvoker) delegate() { for (var i = 0; i < dataGridView1.Rows.Count; i++) { if (((string)dataGridView1.Rows[i].Cells[0].Value) == (string)(acc.username + ' ' + acc.surname)) { dataGridView1.Rows[i].Cells[3].Value = acc.status; break; } } }); }