public override void AddedToDocument(GH_Document document) { base.AddedToDocument(document); executeTimer = new System.Timers.Timer(200) { AutoReset = false, Enabled = false }; executeTimer.Elapsed += ExecuteTimer_Elapsed; if (selectedMethod == null) { var myForm = new PoopUp(); var result = myForm.ShowDialog(); myForm.StartPosition = FormStartPosition.Manual; Grasshopper.GUI.GH_WindowsFormUtil.CenterFormOnCursor(myForm, true); if (result == DialogResult.OK) { selectedMethod = myForm.selectedMethod; SetIO(); } } else { //SetIO(); // io is already set you } }
public override void AddedToDocument(GH_Document document) { base.AddedToDocument(document); if (selectedMethod == null) { var myForm = new PoopUp(); var result = myForm.ShowDialog(); myForm.StartPosition = FormStartPosition.Manual; Grasshopper.GUI.GH_WindowsFormUtil.CenterFormOnCursor(myForm, true); if (result == DialogResult.OK) { selectedMethod = myForm.selectedMethod; SetIO(); } } }