public void ParseXml(XmlElement aNode) { FWidth = int.Parse(aNode.Attributes["width"].Value); FHeight = int.Parse(aNode.Attributes["height"].Value); FRowSpan = int.Parse(aNode.Attributes["rowspan"].Value); FColSpan = int.Parse(aNode.Attributes["colspan"].Value); FAlignVert = (HCAlignVert)(byte.Parse(aNode.Attributes["vert"].Value)); FBackgroundColor = HC.GetXmlRGBColor(aNode.Attributes["bkcolor"].Value); HC.SetBorderSideByPro(aNode.Attributes["border"].Value, FBorderSides); if ((FRowSpan < 0) || (FColSpan < 0)) { FCellData.Dispose(); //FCellData = null; } else { FCellData.ParseXml(aNode.SelectSingleNode("items") as XmlElement); } }
public virtual void ParseXml(XmlElement aNode) { FWidth = int.Parse(aNode.Attributes["width"].Value); FHeight = int.Parse(aNode.Attributes["height"].Value); FRowSpan = int.Parse(aNode.Attributes["rowspan"].Value); FColSpan = int.Parse(aNode.Attributes["colspan"].Value); FAlignVert = (HCAlignVert)(byte.Parse(aNode.Attributes["vert"].Value)); FBackgroundColor = HC.HCRGBStringToColor(aNode.Attributes["bkcolor"].Value); HC.SetBorderSideByPro(aNode.Attributes["border"].Value, FBorderSides); if ((FRowSpan < 0) || (FColSpan < 0)) { FCellData.Dispose(); FCellData = null; } else { FCellData.Width = FWidth; // // 不准确的赋值,应该减去2个水平padding,加载时使用无大碍 FCellData.ParseXml(aNode.SelectSingleNode("items") as XmlElement); } }