private void AddRow(FRowElement row, IBaseCollection<FilterAttributeElement> lista) { foreach (FColElement col in row.Columns) { foreach (IHPatternInstanceElement item in col.Items) { if (item is FilterAttributeElement) lista.Add((item as FilterAttributeElement)); if (item is FGroupElement) { FGroupElement group = item as FGroupElement; foreach (FRowElement grow in group.Rows) { AddRow(grow, lista); } } } } }
public static void AddFilterRow(FRowElement row, StringBuilder rows,HPatternSettings settings) { rows.AppendLine("<tr>"); foreach (FColElement col in row.Columns) { string align = col.Align; if (col.Align == FColElement.AlignValue.Default) { align = settings.Template.CollumnTextAlign.ToLower(); } else { align = align.ToLower(); } rows.AppendLine("<td align=\"" + align + "\" colspan='" + col.ColSpan.ToString() + "' rowspan='" + col.RowSpan.ToString() + "'>"); foreach (IHPatternInstanceElement item in col.Items) { if (item is TextElement) { TextElement text = (item as TextElement); RenderText(text, null, rows, null); } if (item is FilterAttributeElement) { FilterAttributeElement filterVar = item as FilterAttributeElement; if (filterVar.AllValue) { Dictionary<string, object> props = new Dictionary<string, object>(); Template.GetControlInfo(filterVar, props, true); rows.AppendLine(WebForm.Variable(filterVar.Name, null, null, props)); } else { Dictionary<string, object> props = new Dictionary<string, object>(); Template.GetControlSize(filterVar, props); rows.AppendLine(WebForm.Variable(filterVar.Name,null,null,props)); } if (filterVar.Link != null) { StringBuilder textob = new StringBuilder(); Template.LinkImage(textob, filterVar.Link, filterVar.Name, settings); rows.AppendLine(textob.ToString()); } } if (item is FGroupElement) { FGroupElement gobj = item as FGroupElement; contaGroup++; string name = "Group" + contaGroup.ToString().Trim(); string tema = settings.Theme.Group; if (String.IsNullOrEmpty(tema)) tema = "Group"; if (!String.IsNullOrEmpty(gobj.Class)) tema = gobj.Class; rows.AppendLine(WebForm.BeginGroup(name, tema, gobj.Caption)); rows.AppendLine(WebForm.BeginTable("Table"+name,null)); foreach (FRowElement row2 in gobj.Rows) { AddFilterRow(row2, rows, settings); } rows.AppendLine(WebForm.EndTable()); rows.AppendLine(WebForm.EndGroup()); } } rows.AppendLine("</td>"); } rows.AppendLine("</tr>"); }