private void CommandMainForm_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { CommandForm.Close(); } }
protected virtual void Terminate() { _bIsRunning = false; _controlDef.Pressed = false; if (CommandForm != null) { CommandForm.Close(); } CommandForm = null; InteractionManager.Terminate(); }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { application = commandData.Application.Application; doc = commandData.Application.ActiveUIDocument.Document; StoreOriginalVisibility(doc.ActiveView); CommandForm commandForm = new CommandForm(); if (DialogResult.OK == commandForm.ShowDialog()) { analysisCat = commandForm.SelectedAnalysisCategory; commandForm.Close(); mainForm = new MainForm(doc, analysisCat); if (mainForm.FoundStyles) { if (DialogResult.OK == mainForm.ShowDialog()) { DisplayManinForm(); } } } return(Result.Succeeded); }