/// <summary> /// Called when user makes a selection in the menu. /// This is your main exit point to the rest of your Add-in /// </summary> /// <param name="Repository">the repository</param> /// <param name="Location">the location of the menu</param> /// <param name="MenuName">the name of the menu</param> /// <param name="ItemName">the name of the selected menu item</param> public override void EA_MenuClick(EA.Repository Repository, string Location, string MenuName, string ItemName) { switch (ItemName) { case menuComparetoDatabase: this.compareDatabase(); if (debugMode) { new debugForm(_dbCompareControl).Show(); } else { Repository.ActivateTab(compareControlName); } break; case menuCompleteDBwithDLL: this.completeDBwithDLL(); break; case menuAbout: new AboutWindow().ShowDialog(); break; case menuSettings: new EADatabaseTransformerSettingsForm(this.settings).ShowDialog(); break; } }
/// <summary> /// Called when user makes a selection in the menu. /// This is your main exit point to the rest of your Add-in /// </summary> /// <param name="Repository">the repository</param> /// <param name="Location">the location of the menu</param> /// <param name="MenuName">the name of the menu</param> /// <param name="ItemName">the name of the selected menu item</param> public override void EA_MenuClick(EA.Repository Repository, string Location, string MenuName, string ItemName) { try { switch (ItemName) { case menuComparetoDatabase: this.compareDatabase(); if (debugMode) { new debugForm(_dbCompareControl).Show(); } else { Repository.ActivateTab(compareControlName); } break; case menuCompleteDBwithDLL: this.completeDBwithDLL(); break; case menuAbout: new AboutWindow().ShowDialog(); break; case menuSettings: new EADatabaseTransformerSettingsForm(this.settings).ShowDialog(); break; } } catch (Exception e) { //log exception to output window EAOutputLogger.log(string.Format("Exception occured: {0} \n Stacktrace: {1}", e.Message, e.StackTrace)); } }
//Called when user makes a selection in the menu. //This is your main exit point to the rest of your Add-in public void EA_MenuClick(EA.Repository Repository, string Location, string MenuName, string ItemName) { try { EA.Package SelectedPackage = Repository.GetTreeSelectedPackage(); switch (ItemName) { case "Import R1.1": new R11Importer().import(Repository, SelectedPackage); break; case "Import R2": new R2Importer().import(Repository, SelectedPackage); break; case "Validate": new R2Validator().validate(Repository, SelectedPackage); break; case "Update Style": UpdateStyle_recurseEaPackage(SelectedPackage); break; case "Edit Profile": new ProfilingForm().Show(Repository, SelectedPackage); break; case "Compile Profile": CompileProfile(Repository, SelectedPackage); break; case "Merge Profiles": new MergeProfilesForm().PopulateAndShow(); break; case "Create Diagram": CreateDiagram(Repository); break; case "Quick Access Tab": if (view_ctrl == null || !view_ctrl.Visible) { if (view_ctrl != null) { // if control removed dispose old instance view_ctrl.Dispose(); } view_ctrl = (QuickAccessControl)Repository.AddTab("HL7 FM", "HL7_FM_EA_Extension.QuickAccessControl"); view_ctrl.SetRepository(Repository); Repository.ActivateTab("HL7 FM"); } break; case "FM Browser Tab": if (mb_ctrl == null || !mb_ctrl.Visible) { if (mb_ctrl != null) { // if control removed dispose old instance mb_ctrl.Dispose(); } mb_ctrl = (ModelBrowserControl)Repository.AddTab("FM Browser", "HL7_FM_EA_Extension.ModelBrowserControl"); mb_ctrl.SetRepository(Repository); Repository.ActivateTab("FM Browser"); } break; case "About": AboutBox about = new AboutBox(); about.ShowDialog(); break; } } catch (Exception e) { EAHelper.LogMessage(e.ToString()); MessageBox.Show(e.ToString(), "FATAL", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void ActivateTab(string Name) { eaRepository.ActivateTab(Name); }
//Called when user makes a selection in the menu. //This is your main exit point to the rest of your Add-in public void EA_MenuClick(EA.Repository Repository, string Location, string MenuName, string ItemName) { try { EA.Package selectedPackage = Repository.GetTreeSelectedPackage(); switch (ItemName) { case "Import": Repository.CreateOutputTab(MAX_TABNAME); Repository.ClearOutput(MAX_TABNAME); if (new Filters().import(Repository, selectedPackage)) { // only popup when there were any issues Repository.EnsureOutputVisible(MAX_TABNAME); } break; case "Import NoDelRel": Repository.CreateOutputTab(MAX_TABNAME); Repository.ClearOutput(MAX_TABNAME); if (new Filters().import(Repository, selectedPackage, false)) { // only popup when there were any issues Repository.EnsureOutputVisible(MAX_TABNAME); } break; case "Export": Repository.CreateOutputTab(MAX_TABNAME); Repository.ClearOutput(MAX_TABNAME); if (new Filters().export(Repository)) { // only popup when there were any issues Repository.EnsureOutputVisible(MAX_TABNAME); } break; case "Filters": // TODO: create Config Filters Dialogs MessageBox.Show("NYI"); break; case "Transform": Repository.CreateOutputTab(MAX_TABNAME); Repository.ClearOutput(MAX_TABNAME); if (new TransformParamsForm().Show(Repository)) { // only popup when there were any issues Repository.EnsureOutputVisible(MAX_TABNAME); } break; case "Validate": Repository.CreateOutputTab(MAX_TABNAME); Repository.ClearOutput(MAX_TABNAME); if (new ValidateParamsForm().Show(Repository)) { // only popup when there were any issues Repository.EnsureOutputVisible(MAX_TABNAME); } break; case "Merge Diagrams": mergeDiagrams(Repository, selectedPackage); break; case "Lock": setLocked(selectedPackage, true); break; case "Unlock": setLocked(selectedPackage, false); break; case "Batch": batch(Repository); break; case "Quick Access Tab": if (view_ctrl == null || !view_ctrl.Visible) { if (view_ctrl != null) { // if control removed dispose old instance view_ctrl.Dispose(); } view_ctrl = (QuickAccessControl)Repository.AddTab(MAX_TABNAME, "MAX_EA_Extension.QuickAccessControl"); view_ctrl.SetRepository(Repository); Repository.ActivateTab(MAX_TABNAME); } break; case "About...": AboutBox about = new AboutBox(); about.ShowDialog(); break; } } catch (Exception e) { MessageBox.Show(e.ToString()); } }