private void addNewAccountButton_Click(object sender, EventArgs e) { SipAccountConfig cfg = new SipAccountConfig(); SipAccountEditorForm f = new SipAccountEditorForm(cfg); if (f.ShowDialog() == DialogResult.OK) { if (SipAccountManager.Default.DefaultAcrcount == null) { cfg.IsDefault = true; } bindingSourceSipAccounts.Add(cfg); } }
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(); } }