Пример #1
0
 public static XElement ToXml(GradientRecordRGB record)
 {
     return(new XElement("GradientItem",
                         new XAttribute("position", record.Ratio),
                         new XElement("color", XColorRGB.ToXml(record.Color))
                         ));
 }
Пример #2
0
        public static XElement ToXml(SolidFillStyleRGB fillStyle)
        {
            var res = new XElement(SOLID);

            res.Add(new XElement("color", XColorRGB.ToXml(fillStyle.Color)));
            return(res);
        }
Пример #3
0
        public static XElement ToXmlRGB(TextRecordRGB entry)
        {
            var res = new XElement(XName.Get("TextRecord6"));

            res.Add(new XAttribute("isSetup", CommonFormatter.Format(entry.Type)));
            if (entry.FontID.HasValue)
            {
                res.Add(new XAttribute("objectID", entry.FontID.Value));
            }
            if (entry.Reserved != 0)
            {
                res.Add(new XAttribute("reserved", entry.Reserved));
            }
            if (entry.XOffset.HasValue)
            {
                res.Add(new XAttribute("x", entry.XOffset.Value));
            }
            if (entry.YOffset.HasValue)
            {
                res.Add(new XAttribute("y", entry.YOffset.Value));
            }
            if (entry.FontID.HasValue)
            {
                if (!entry.TextHeight.HasValue)
                {
                    throw new InvalidOperationException("Text Height must be specified");
                }
                res.Add(new XAttribute("fontHeight", entry.TextHeight.Value));
            }
            if (entry.TextColor.HasValue)
            {
                var color = entry.TextColor.Value;
                res.Add(new XElement("color", XColorRGB.ToXml(color)));
            }
            res.Add(new XElement(XName.Get("glyphs"), entry.Glyphs.Select(FormatGlyphEntry)));
            return(res);
        }
Пример #4
0
 protected override void FormatTagElement(SetBackgroundColorTag tag, XElement xTag)
 {
     xTag.Add(new XElement("color", XColorRGB.ToXml(tag.Color)));
 }
Пример #5
0
 public static XElement ToXml(LineStyleRGB lineStyle)
 {
     return(new XElement("LineStyle",
                         new XAttribute("width", lineStyle.Width),
                         new XElement("color", XColorRGB.ToXml(lineStyle.Color))));
 }