/// <summary> /// Adds a navigatiobar for the screen /// </summary> /// <param name="pathToXml">path of the used template (XML)</param> /// <param name="screenName">name of the screen on wich the navigation bar should be added</param> /// <param name="typeOfView">name of the type of view in which the navigation bar should be added</param> public void addNavigationbarForScreen(string pathToXml, String screenName, String typeOfView) { TemplateUiObject templateObject = getTemplateUiObjectOfNavigationbarScreen(pathToXml); if (templateObject.Equals(new TemplateUiObject())) { return; } List <String> screens = treeOperation.searchNodes.getPosibleScreenNames(typeOfView); List <String> screenNavi = new List <string>(); //screenNavi.Add(strategyMgr.getSpecifiedTree().GetData(subtree).brailleRepresentation.screenName); screenNavi.Add(screenName); templateObject.Screens = screenNavi; List <OSMElements.OSMElement> groupElementsStatic = calculatePositionOfScreenTab(screens, templateObject); if (groupElementsStatic == null || groupElementsStatic.Equals(new List <OSMElements.OSMElement>())) { return; } templateObject.groupElements = groupElementsStatic; Object tree = grantTrees.filteredTree; BrailleRepresentation br = templateObject.osm.brailleRepresentation; br.groupelementsOfSameType = new GroupelementsOfSameType(); OSMElements.OSMElement osm = templateObject.osm; osm.brailleRepresentation = br; templateObject.osm = osm; ATemplateUi generalUiInstance = new TemplateGroupStatic(strategyMgr, grantTrees, treeOperation); generalUiInstance.createUiElementFromTemplate(tree, templateObject); }
/// <summary> /// Creates navigation bars for every screen in this tpye of view /// </summary> /// <param name="pathToXml">path of the used template (XML)</param> /// <param name="typeOfView">name of the type of view in which the navigation bars should be added</param> public void createNavigationbar(string pathToXml, String typeOfView) { TemplateUiObject templateObject = getTemplateUiObjectOfNavigationbarScreen(pathToXml); if (templateObject.Equals(new TemplateUiObject())) { return; } //TODO: mit Events verknüpfen List <String> screens = treeOperation.searchNodes.getPosibleScreenNames(typeOfView); ATemplateUi generalUiInstance; if (templateObject.Screens == null) { //we use all available screens of this tpye of view templateObject.Screens = screens; } List <OSMElements.OSMElement> groupElementsStatic = calculatePositionOfScreenTab(screens, templateObject); if (groupElementsStatic == null || groupElementsStatic.Equals(new List <OSMElements.OSMElement>())) { return; } templateObject.groupElements = groupElementsStatic; // templateObject.osm = templateObject.osm; templateObject.osm.brailleRepresentation.groupelementsOfSameType = new GroupelementsOfSameType(); generalUiInstance = new TemplateGroupStatic(strategyMgr, grantTrees, treeOperation); Object tree = grantTrees.filteredTree; generalUiInstance.createUiElementFromTemplate(tree, templateObject);// }
/// <summary> /// Updates all navigation bars in this type of view /// </summary> /// <param name="pathToXml">path of the used template(XML)</param> /// <param name="typeOfView">name of the type of view in which the navigation bar should be updated</param> public void updateNavigationbarScreens(string pathToXml, String typeOfView) { TemplateUiObject templateObject = getTemplateUiObjectOfNavigationbarScreen(pathToXml); if (templateObject.Equals(new TemplateUiObject())) { return; } List <String> screens = treeOperation.searchNodes.getPosibleScreenNames(typeOfView); // searches for navigation bars in the braille tree and adds new tabs List <Object> navigationbars = treeOperation.searchNodes.getListOfNavigationbars(); List <String> screensForShowNavigationbar = new List <string>(); foreach (Object nbar in navigationbars) { if (strategyMgr.getSpecifiedTree().HasChild(nbar)) { treeOperation.updateNodes.removeChildNodeInBrailleTree(nbar); treeOperation.updateNodes.removeNodeInBrailleTree(strategyMgr.getSpecifiedTree().GetData(nbar).properties.IdGenerated); } screensForShowNavigationbar.Add(strategyMgr.getSpecifiedTree().GetData(nbar).brailleRepresentation.screenName); } templateObject.Screens = screensForShowNavigationbar; List <OSMElements.OSMElement> groupElements = calculatePositionOfScreenTab(screens, templateObject); if (groupElements == null || groupElements.Equals(new List <OSMElements.OSMElement>())) { return; } templateObject.groupElements = groupElements; Object tree = grantTrees.filteredTree; // OSMElement.OSMElement osm = templateObject.osm; templateObject.osm.brailleRepresentation.groupelementsOfSameType = new GroupelementsOfSameType(); // templateObject.osm = osm; ATemplateUi generalUiInstance = new TemplateGroupStatic(strategyMgr, grantTrees, treeOperation); generalUiInstance.createUiElementFromTemplate(tree, templateObject); }