/// <summary> /// Calculates the column width for the middle block /// Takes the ColumnWidth from the Parent Node which applies to right and left /// However the inline "width" attributes overrides the Parent's colwidth attribute /// </summary> /// <param name="section"></param> /// <param name="_type"></param> /// <returns></returns> public static string CalculateColumnWidth(XmlTag section, Placeholders _type) { string width = "20"; foreach (XmlTag tag in section.LSTChildNodes) { if (Utils.CompareStrings(_type, Utils.GetAttributeValueByName(tag, XmlAttributeTypes.NAME))) { int widthIndex = -1; widthIndex = tag.LSTAttributes.FindIndex( delegate(LayoutAttribute tagAttr) { return (Utils.CompareStrings(tagAttr.Name, XmlAttributeTypes.WIDTH)); } ); if (widthIndex > -1) { width = tag.LSTAttributes[widthIndex].Value; } else { foreach (LayoutAttribute attr in section.LSTAttributes) { if (Utils.CompareStrings(attr.Name, XmlAttributeTypes.WIDTH)) { width = attr.Value; } else if (Utils.CompareStrings(attr.Name, XmlAttributeTypes.COLWIDTH)) { width = attr.Value; } } } } } return width; }