private void ReadBaseRectangleVObjectAttributes(BaseRectangleVObject vObject, SvgElement svg) { ReadVObjectAttributes(vObject, svg); foreach (var attr in svg.CustomAttributes.Where(attr => attr.NamespaceUri == XmlNamespace.AurigmaVectorObjects)) { switch (attr.LocalName) { case "text-wrapping-mode": vObject.TextWrappingMode = SvgAttribute.ParseEnumAttribute(attr.GetValue(), TextWrappingMode.None); break; case "opacity": vObject.Opacity = SvgAttribute.ParseFloatAttribute(attr.GetValue(), 1.0f); break; } } }
public override IEnumerable <SvgAttribute> GetAttributes() { var baseAttributes = base.GetAttributes(); if (baseAttributes != null) { foreach (var attr in baseAttributes) { yield return(attr); } } yield return(new SvgAttribute("wrapping-rectanlges", null, XmlNamespace.AurigmaVectorObjects, () => WrappingRectanglesJson, v => WrappingRectanglesJson = v )); yield return(new SvgAttribute("wrapping-margin", null, XmlNamespace.AurigmaVectorObjects, () => WrappingMargin.ToString(CultureInfo.InvariantCulture), v => WrappingMargin = SvgAttribute.ParseFloatAttribute(v) )); yield return(new SvgAttribute("paragraph-settings", null, XmlNamespace.AurigmaVectorObjects, () => ParagraphSettingsJson, v => ParagraphSettingsJson = v )); yield return(new SvgAttribute("vertical-alignment", TextVerticalAlignment.Top.ToString().ToLowerInvariant(), XmlNamespace.AurigmaVectorObjects, () => VerticalAlignment.ToString().ToLowerInvariant(), v => VerticalAlignment = SvgAttribute.ParseEnumAttribute <TextVerticalAlignment>(v) )); yield return(new SvgAttribute("is-vertical", bool.FalseString, () => IsVertical.ToString(), v => IsVertical = SvgAttribute.ParseBooleanAttribute(v) )); }
public override IEnumerable <SvgAttribute> GetAttributes() { var baseAttributes = base.GetAttributes(); if (baseAttributes != null) { foreach (var attr in baseAttributes) { yield return(attr); } } yield return (new SvgAttribute("alignment", TextAlignment.Left.ToString().ToLowerInvariant(), XmlNamespace.AurigmaVectorObjects, () => Alignment.ToString().ToLowerInvariant(), v => Alignment = SvgAttribute.ParseEnumAttribute <TextAlignment>(v))); yield return (new SvgAttribute("text-color", "", XmlNamespace.AurigmaVectorObjects, () => _textColor, v => _textColor = v)); yield return (new SvgAttribute("font-postscript-name", "", XmlNamespace.AurigmaVectorObjects, () => _font.PostScriptName, v => { if (_font == null) { _font = new FontSettings(); } _font.PostScriptName = v; })); yield return (new SvgAttribute("font-fauxbold", bool.FalseString, XmlNamespace.AurigmaVectorObjects, () => _font.FauxBold.ToString(CultureInfo.InvariantCulture), v => { if (_font == null) { _font = new FontSettings(); } _font.FauxBold = SvgAttribute.ParseBooleanAttribute(v); })); yield return (new SvgAttribute("font-fauxitalic", bool.FalseString, XmlNamespace.AurigmaVectorObjects, () => _font.FauxItalic.ToString(CultureInfo.InvariantCulture), v => { if (_font == null) { _font = new FontSettings(); } _font.FauxItalic = SvgAttribute.ParseBooleanAttribute(v); })); yield return (new SvgAttribute("tracking", "0", () => Tracking.ToString(CultureInfo.InvariantCulture), v => Tracking = SvgAttribute.ParseFloatAttribute(v))); yield return (new SvgAttribute("leading", "0", () => Leading.ToString(CultureInfo.InvariantCulture), v => Leading = SvgAttribute.ParseFloatAttribute(v))); yield return (new SvgAttribute("is-rich-text", bool.FalseString, () => IsRichText.ToString(), v => IsRichText = SvgAttribute.ParseBooleanAttribute(v))); yield return (new SvgAttribute("vertical-scale", "0", () => VerticalScale.ToString(CultureInfo.InvariantCulture), v => VerticalScale = SvgAttribute.ParseFloatAttribute(v))); yield return (new SvgAttribute("horizontal-scale", "0", () => HorizontalScale.ToString(CultureInfo.InvariantCulture), v => HorizontalScale = SvgAttribute.ParseFloatAttribute(v))); yield return (new SvgAttribute("italic", bool.FalseString, null, v => _oldItalic = SvgAttribute.ParseBooleanAttribute(v))); }