private void ExecuteSynchronizeSingleElement() { object selectedItem; EAAPI.ObjectType objectType = _repository.GetTreeSelectedItem(out selectedItem); EAAPI.Element element = selectedItem as EAAPI.Element; _projectIntegrator.SynchronizeSingleElement(element); }
public object EA_GetMenuItems(EAAPI.Repository repository, string location, string menuName) { object result = ""; List <string> menuEntries = new List <string>(); object selectedItem = null; EAAPI.ObjectType objectType = repository.GetTreeSelectedItem(out selectedItem); EAAPI.Element selectedElement = null; if (objectType == EAAPI.ObjectType.otElement) { selectedElement = selectedItem as EAAPI.Element; } else if (objectType == EAAPI.ObjectType.otPackage) { EAAPI.Package package = selectedItem as EAAPI.Package; selectedElement = package.Element; } switch (menuName) { // defines the top level menu option case "": result = MAIN_MENU; break; // defines the submenu options case MAIN_MENU: if (location == "TreeView") { //menuEntries.Add(EXPORT_MENU); //menuEntries.Add("-"); menuEntries.Add(SYNC_PROJECT_ROOTS_MENU); menuEntries.Add(SYNC_HIERARHY_ROOTS_MENU); menuEntries.Add(SYNC_HIERARHY_MENU); if (selectedElement != null && selectedElement.Type == "Requirement" && selectedElement.Stereotype == "fmcreq" && !string.IsNullOrEmpty(_configuration.JiraURL) && string.IsNullOrEmpty(selectedElement.GetTaggedValueString("specifId"))) { menuEntries.Add("-"); menuEntries.Add(ADD_REQIOREMENT_TO_SPECIF_REPOSITORY_MENU); } if (selectedElement != null && !string.IsNullOrEmpty(selectedElement.GetTaggedValueString("specifId"))) { menuEntries.Add("-"); menuEntries.Add(SYNC_SINGLE_ELEMENT_MENU); } if (objectType == EAAPI.ObjectType.otPackage && selectedElement != null && selectedElement.Stereotype == "specification") { menuEntries.Add("-"); menuEntries.Add(ADD_SPECIFICATION_TO_SPECIF_MENU); } } else if (location == "MainMenu") { menuEntries.Add(EDIT_SETTINGS_MENU); menuEntries.Add("-"); menuEntries.Add(ABOUT_MENU); } result = menuEntries.ToArray(); break; } return(result); }