private static void ParseQueryForUI(List <UIBase> attributes, IElement element, int[] layout) { int[] elmLayout = GetLayout(element.Style, layout); var tmp = new UIQuery() { x = elmLayout[0], y = elmLayout[1], width = elmLayout[2], height = elmLayout[3] }; tmp.Text = element.TextContent; tmp.WidthLabel = element.GetWidth(); tmp.NestedName = element.GetAttribute("nested-name"); tmp.Owner = element.GetAttribute("owner"); tmp.QueryUID = element.GetAttribute("query"); if (tmp != null) { // find the frame it belongs to foreach (var item in attributes) { var frame = item as UIFrame; if (frame != null) { if (tmp.IsIn(frame)) { frame.AddChild(tmp); return; } } } UIFrame lastframe = null; foreach (var item in attributes) { if (item.NestedName == "NO_FRAME") { lastframe = item as UIFrame; break; } } if (lastframe == null) { lastframe = new UIFrame() { NestedName = "NO_FRAME", TabIndex = 99 }; attributes.Add(lastframe); } lastframe.AddChild(tmp); } }
//Funcion para extraer información de atributos private void processDisplayElement(UIBase myAttribute) { if (myAttribute.ContainsNestedName("Z10T00002.Z001Q")) //Si el atributo es una query de Arbol de Fallos, parseo los datos { this.isPEMActivity = true; UIFrame queryFrame = (UIFrame)myAttribute; UIQuery arbolFallasQuery = (UIQuery)queryFrame.Children[0]; CRow[] myRows = arbolFallasQuery.Result.Rows; foreach (CRow line in myRows) { this.FailureTreeFullLabels.Add(line.Items.ElementAt(0).Text); //la columna cero es el fullLabel this.FailureTreeDescriptions.Add(line.Items.ElementAt(1).Text); //la columna uno es la descripción } parseFailureTreeInfo(); } }
public UICondition OrWith(string newCondition, params object[] objects) { return(new UICondition(condition: new GlobalizableOrCondition(GlobalizableCondition, UIQuery.Parse(query: newCondition, objects: objects)))); }
public static UICondition Create(string query, params object[] objects) { return(new UICondition(condition: UIQuery.Parse(query: query, objects: objects))); }