private void btnEdit_Click(object sender, EventArgs e) { logOptChosen = (Logger)cmbLog.SelectedItem; if (logOption == null || logOption.IsDisposed) { logOption = new EditLogForm(log, logOptChosen, this); } logOption.Show(); }
private void btnAddNew_Click(object sender, EventArgs e) { string newLogName = "Log " + (cmbLog.Items.Count); if (!cmbLog.Items.Contains(newLogName)) { // Helps in repopulating of combobox. BindingManagerBase bmOrders = this.BindingContext[log.getLogList()]; bmOrders.SuspendBinding(); log.AddNewLogger(newLogName); bmOrders.ResumeBinding(); } else { MessageBox.Show("?"); return; } cmbLog.SelectedItem = log.FindLogger(newLogName); logOptChosen = (Logger)cmbLog.SelectedItem; if (logOption == null || logOption.IsDisposed) { logOption = new EditLogForm(log, logOptChosen, this); } logOption.Show(); /* * if (addOption == null || addOption.IsDisposed) * { * addOption = new AddLogForm(this, log); * } * addOption.Show(); * */ }
private void btnAddNew_Click(object sender, EventArgs e) { string newLogName = "Log " + (cmbLog.Items.Count); if (!cmbLog.Items.Contains(newLogName)) { // Helps in repopulating of combobox. BindingManagerBase bmOrders = this.BindingContext[log.getLogList()]; bmOrders.SuspendBinding(); log.AddNewLogger(newLogName); bmOrders.ResumeBinding(); } else { MessageBox.Show("?"); return; } cmbLog.SelectedItem = log.FindLogger(newLogName); logOptChosen = (Logger)cmbLog.SelectedItem; if (logOption == null || logOption.IsDisposed) { logOption = new EditLogForm(log, logOptChosen, this); } logOption.Show(); /* if (addOption == null || addOption.IsDisposed) { addOption = new AddLogForm(this, log); } addOption.Show(); * */ }