Beispiel #1
0
        public void ParseXml(XmlElement aNode)
        {
            FFamily    = aNode.InnerText;
            FSize      = float.Parse(aNode.Attributes["size"].Value);
            FColor     = HC.HCRGBStringToColor(aNode.Attributes["color"].Value);
            FBackColor = HC.HCRGBStringToColor(aNode.Attributes["bkcolor"].Value);

            string[] vsStyles = aNode.Attributes["style"].Value.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < vsStyles.Length; i++)
            {
                if (vsStyles[i] == "bold")
                {
                    FFontStyles.InClude((byte)HCFontStyle.tsBold);
                }
                else
                if (vsStyles[i] == "italic")
                {
                    FFontStyles.InClude((byte)HCFontStyle.tsItalic);
                }
                else
                if (vsStyles[i] == "underline")
                {
                    FFontStyles.InClude((byte)HCFontStyle.tsUnderline);
                }
                else
                if (vsStyles[i] == "strikeout")
                {
                    FFontStyles.InClude((byte)HCFontStyle.tsStrikeOut);
                }
                else
                if (vsStyles[i] == "sup")
                {
                    FFontStyles.InClude((byte)HCFontStyle.tsSuperscript);
                }
                else
                if (vsStyles[i] == "sub")
                {
                    FFontStyles.InClude((byte)HCFontStyle.tsSubscript);
                }
            }
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
 public virtual void ParseXml(XmlElement aNode)
 {
     FStyle   = (HCShapeStyle)byte.Parse(aNode.Attributes["style"].Value);
     FVersion = byte.Parse(aNode.Attributes["ver"].Value);
     FColor   = HC.HCRGBStringToColor(aNode.Attributes["color"].Value);
 }
Beispiel #4
0
        public void ParseXml(XmlElement aNode)
        {
            FirstIndent = float.Parse(aNode.Attributes["firstindent"].Value);
            LeftIndent  = float.Parse(aNode.Attributes["leftindent"].Value);
            RightIndent = float.Parse(aNode.Attributes["rightindent"].Value);
            FBackColor  = HC.HCRGBStringToColor(aNode.Attributes["bkcolor"].Value);
            FBreakRough = aNode.GetAttribute("breakrough") == "1";
            //GetXMLLineSpaceMode_;
            if (aNode.Attributes["spacemode"].Value == "100")
            {
                FLineSpaceMode = ParaLineSpaceMode.pls100;
            }
            else
            if (aNode.Attributes["spacemode"].Value == "115")
            {
                FLineSpaceMode = ParaLineSpaceMode.pls115;
            }
            else
            if (aNode.Attributes["spacemode"].Value == "150")
            {
                FLineSpaceMode = ParaLineSpaceMode.pls150;
            }
            else
            if (aNode.Attributes["spacemode"].Value == "200")
            {
                FLineSpaceMode = ParaLineSpaceMode.pls200;
            }
            else
            if (aNode.Attributes["spacemode"].Value == "min")
            {
                FLineSpaceMode = ParaLineSpaceMode.plsMin;
            }
            else
            if (aNode.Attributes["spacemode"].Value == "mult")
            {
                FLineSpaceMode = ParaLineSpaceMode.plsMult;
            }
            else
            if (aNode.Attributes["spacemode"].Value == "fix")
            {
                FLineSpaceMode = ParaLineSpaceMode.plsFix;
            }

            //GetXMLHorz_;
            if (aNode.Attributes["horz"].Value == "left")
            {
                FAlignHorz = ParaAlignHorz.pahLeft;
            }
            else
            if (aNode.Attributes["horz"].Value == "right")
            {
                FAlignHorz = ParaAlignHorz.pahRight;
            }
            else
            if (aNode.Attributes["horz"].Value == "center")
            {
                FAlignHorz = ParaAlignHorz.pahCenter;
            }
            else
            if (aNode.Attributes["horz"].Value == "justify")
            {
                FAlignHorz = ParaAlignHorz.pahJustify;
            }
            else
            if (aNode.Attributes["horz"].Value == "scatter")
            {
                FAlignHorz = ParaAlignHorz.pahScatter;
            }

            //GetXMLVert_;
            if (aNode.Attributes["vert"].Value == "top")
            {
                FAlignVert = ParaAlignVert.pavTop;
            }
            else
            if (aNode.Attributes["vert"].Value == "center")
            {
                FAlignVert = ParaAlignVert.pavCenter;
            }
            else
            if (aNode.Attributes["vert"].Value == "bottom")
            {
                FAlignVert = ParaAlignVert.pavBottom;
            }
        }