// Custom fields on back sides private void custombackbutton_Click(object sender, EventArgs e) { // Make collection of back sides List <MapElement> sides = new List <MapElement>(lines.Count); foreach (Linedef l in lines) { if (l.Back != null) { sides.Add(l.Back); } } // Make undo string undodesc = "sidedef"; if (sides.Count > 1) { undodesc = sides.Count + " sidedefs"; } General.Map.UndoRedo.CreateUndo("Edit " + undodesc); // Edit these if (!CustomFieldsForm.ShowDialog(this, "Back side custom fields", "sidedef", sides, General.Map.Config.SidedefFields)) { General.Map.UndoRedo.WithdrawUndo(); } }
// This shows the dialog, returns false when cancelled public static bool ShowDialog(IWin32Window owner, string title, string elementname, ICollection <MapElement> elements, List <UniversalFieldInfo> fixedfields) { CustomFieldsForm f = new CustomFieldsForm(); f.Setup(title, elementname, elements, fixedfields); bool result = (f.ShowDialog(owner) == DialogResult.OK); f.Dispose(); return(result); }
// Custom fields on back sides private void custombackbutton_Click(object sender, EventArgs e) { // Make collection of back sides List <MapElement> sides = new List <MapElement>(lines.Count); foreach (Linedef l in lines) { if (l.Back != null) { sides.Add(l.Back); } } // Edit these CustomFieldsForm.ShowDialog(this, "Back side custom fields", "sidedef", sides, General.Map.Config.SidedefFields); }