private void addScanToolStripMenuItem_Click(object sender, EventArgs e) { using (var dialog = new ScanDialog(master)) { if (dialog.ShowDialog() == DialogResult.OK) { foreach (var scan in dialog.ConfiguredScans) { scans.Add(scan); } this.RefreshScanList(); } } }