public static DialogResult AddLapModal(Timer t, System.Windows.Forms.IWin32Window owner) { if (t == null) { return(DialogResult.Cancel); } AddLap a = new AddLap(); a.timer = t; a.cboTask.Items.Clear(); a.cboTask.Items.AddRange(t.GetTaskList().ToArray()); return(a.ShowDialog(owner)); }
private void btnAddLap_Click(object sender, System.EventArgs e) { Timer t = this.GetSelectedTimer(); if (t == null) { return; } DialogResult dr = AddLap.AddLapModal(t, this); if (dr != DialogResult.OK) { return; } timers.Save(); }