private void sipAccountsDataGrid_DeleteDataRow(object sender, VisualAsterisk.Manager.Controls.DataRowEventArgs e) { SipAccountConfig user = e.DataRow.DataBoundItem as SipAccountConfig; if (user == null) { return; } if (MessageBox.Show(string.Format(Properties.LocalizedStrings.Message_DeleteSipAccount, user.AccountName), Properties.LocalizedStrings.Message_DeleteSipAccount_Caption, MessageBoxButtons.OKCancel) == DialogResult.OK) { this.bindingSourceSipAccounts.RemoveCurrent(); } if (SipAccountManager.Default.DefaultAcrcount == null && SipAccountManager.Default.SipAccounts.Count > 0) { SipAccountManager.Default.SipAccounts[0].IsDefault = true; } }
private void sipAccountsDataGrid_EditDataRow(object sender, VisualAsterisk.Manager.Controls.DataRowEventArgs e) { SipAccountConfig cfg = e.DataRow.DataBoundItem as SipAccountConfig; if (cfg == null) { return; } cfg.BeginEdit(); SipAccountEditorForm f = new SipAccountEditorForm(cfg); if (f.ShowDialog() == DialogResult.OK) { cfg.EndEdit(); this.Invalidate(); } else { cfg.CancelEdit(); } }