public static DialogResult Show(IWin32Window Owner, List <Frame> Frames) { NewFrameDialog nfd = new NewFrameDialog() { frames = Frames }; foreach (Frame f in Frames) { nfd.frameSelector.Items.Add(f); } nfd.name.Text = "Frame" + Frames.Count; if (nfd.frameSelector.Items == null || nfd.frameSelector.Items.Count == 0) { nfd.isDuplicate.Enabled = false; } if (Frames != null && Frames.Count != 0) { nfd.frameSelector.SelectedIndex = 0; } nfd.isDuplicate.Checked = Duplicate; nfd.autosel.Checked = AutoSelect; return(nfd.ShowDialog(Owner)); }
private void createClick(object sender, EventArgs e) { if (NewFrameDialog.Show(ParentForm, frames) == DialogResult.OK) { FrameAdded?.Invoke(frames[frames.Count - 1]); refreshFrames(); if (NewFrameDialog.AutoSelect) { frameSelector.SelectedIndex = frames.Count - 1; } } }