/// <summary> /// Creates UI elements (braille nodes) for the symbol view which have no connection to the filtered tree /// </summary> /// <param name="pathToTemplate">path of the used template (XML)</param> private void createUiElementsWitheNoDependencySymbolView(String pathToTemplate) { XElement xmlDoc = XElement.Load(pathToTemplate); if (xmlDoc.Element(VIEWCATEGORY_SYMBOLVIEW) == null) { return; } IEnumerable <XElement> uiElement = from el in xmlDoc.Element(VIEWCATEGORY_SYMBOLVIEW).Elements("UiElement") where (string)el.Element("TextFromUIElement") != null && (string)el.Element("TextFromUIElement") == "" && (string)el.Element("Screens") != null && (string)el.Element("Screens") != "" select el; if (uiElement == null || !uiElement.Any()) { return; } foreach (XElement element in uiElement) { ATemplateUi generalUiInstance; TemplateUiObject templateObject = xmlUiElementToTemplateUiObject(element, VIEWCATEGORY_SYMBOLVIEW); if (templateObject.osm.brailleRepresentation.groupelementsOfSameType.Equals(new GroupelementsOfSameType())) { generalUiInstance = new TemplateNode(strategyMgr, grantTrees, treeOperation); } else { generalUiInstance = new TemplateGroupAutomatic(strategyMgr, grantTrees, treeOperation); } Object tree = strategyMgr.getSpecifiedTree().NewTree(); generalUiInstance.createUiElementFromTemplate(tree, templateObject); } }
/// <summary> /// Creates for all screens of the list a braille node depending on the template object /// </summary> /// <param name="screenList">the list of screen names</param> /// <param name="tree">a filtered tree object</param> /// <param name="templateObject">the template object</param> private void createsBrailleNodeForScreenList(List <String> screenList, ref Object tree, TemplateUiObject templateObject) { if (screenList == null) { return; } ATemplateUi generalUiInstance; if (templateObject.osm.brailleRepresentation.groupelementsOfSameType.Equals(new GroupelementsOfSameType())) { generalUiInstance = new TemplateNode(strategyMgr, grantTrees, treeOperation); } else { generalUiInstance = new TemplateGroupAutomatic(strategyMgr, grantTrees, treeOperation); } foreach (String screen in screenList) { TemplateUiObject copyTemp = templateObject.DeepCopy(); copyTemp.Screens = new List <string>(); copyTemp.Screens.Add(screen); generalUiInstance.createUiElementFromTemplate(tree, copyTemp); } }
/// <summary> /// Converts a filtered (sub-)tree to symbole (for the braille tree) and adds this node /// </summary> /// <param name="subtree">filtered (sub-)tree to convert as symbols</param> /// <param name="pathToXml">path of the used template (XML)</param> private void createElementTypeOfSymbolView(Object subtree, String pathToXml) { String controlType = strategyMgr.getSpecifiedTree().GetData(subtree).properties.controlTypeFiltered; XElement xmlDoc = XElement.Load(@pathToXml); if (xmlDoc.Element(VIEWCATEGORY_SYMBOLVIEW) == null) { return; } IEnumerable <XElement> uiElement = from el in xmlDoc.Element(VIEWCATEGORY_SYMBOLVIEW).Elements("UiElement") where (string)el.Attribute("name") == controlType && (string)el.Element("TextFromUIElement") != null && (string)el.Element("TextFromUIElement") != "" && (string)el.Element("Screens") != null && (string)el.Element("Screens") != "" select el; if (uiElement == null || !uiElement.Any()) { return; } ATemplateUi generalUiInstance; foreach (XElement element in uiElement) { TemplateUiObject templateObject = xmlUiElementToTemplateUiObject(element, VIEWCATEGORY_SYMBOLVIEW); if (templateObject.osm.brailleRepresentation.groupelementsOfSameType.Equals(new GroupelementsOfSameType())) { generalUiInstance = new TemplateNode(strategyMgr, grantTrees, treeOperation); } else { generalUiInstance = new TemplateGroupAutomatic(strategyMgr, grantTrees, treeOperation); } generalUiInstance.createUiElementFromTemplate(subtree, templateObject); } }