/// <summary> /// Creates a new /// <see cref="ColTagWorker"/> /// instance. /// </summary> /// <param name="element">the element</param> /// <param name="context">the context</param> public ColTagWorker(IElementNode element, ProcessorContext context) { int?span = CssDimensionParsingUtils.ParseInteger(element.GetAttribute(AttributeConstants.SPAN)); col = new ColWrapper(span != null ? (int)span : 1); col.SetLang(element.GetAttribute(AttributeConstants.LANG)); }
public DesignedOrder(XmlElement xml, QueryDesignFrame frame) { var table = frame.FindTableFromSaveId(xml.FindElement("TableSaveId").InnerText); m_column = new ColWrapper(frame, table, xml.FindElement("Column").InnerText); this.LoadPropertiesCore(xml); }
/// <summary>Applies column styles.</summary> /// <param name="node">the node</param> /// <param name="rowColHelper">the helper class to keep track of the position inside the table</param> private void ApplyColStyles(INode node, RowColHelper rowColHelper) { int col; IElementNode element; foreach (INode child in node.ChildNodes()) { if (child is IElementNode) { element = (IElementNode)child; if (TagConstants.TR.Equals(element.Name())) { ApplyColStyles(element, rowColHelper); rowColHelper.NewRow(); } else { if (TagConstants.TH.Equals(element.Name()) || TagConstants.TD.Equals(element.Name())) { int?colspan = CssUtils.ParseInteger(element.GetAttribute(AttributeConstants.COLSPAN)); int?rowspan = CssUtils.ParseInteger(element.GetAttribute(AttributeConstants.ROWSPAN)); colspan = colspan != null ? colspan : 1; rowspan = rowspan != null ? rowspan : 1; col = rowColHelper.MoveToNextEmptyCol(); if (GetColWrapper(col) != null) { ColWrapper colWrapper = GetColWrapper(col); if (colWrapper.GetCellCssProps() != null) { element.AddAdditionalHtmlStyles(colWrapper.GetCellCssProps()); } String elemLang = element.GetAttribute(AttributeConstants.LANG); String trLang = null; if (node is IElementNode) { trLang = ((IElementNode)node).GetAttribute(AttributeConstants.LANG); } if (trLang == null && colWrapper.GetLang() != null && elemLang == null) { element.GetAttributes().SetAttribute(AttributeConstants.LANG, colWrapper.GetLang()); } } rowColHelper.UpdateCurrentPosition((int)colspan, (int)rowspan); } else { ApplyColStyles(child, rowColHelper); } } } } }
public bool Equals(ColWrapper obj) { return _col.Equals(obj._col); }
public bool Equals(ColWrapper obj) { return(_col.Equals(obj._col)); }
public DesignedOrder(ColWrapper column, bool desc) { m_column = column; m_desc = desc; }