示例#1
0
 void IXmlSerializable.WriteXml(XmlWriter writer)
 {
     Serializer.InitWriter(writer);
     if (this.fontStretchSet)
     {
         Serializer.SerializeObj(this.fontStretch.ToString(), "FontStretch", writer);
     }
     if (this.fontStyleSet)
     {
         Serializer.SerializeObj(this.fontStyle.ToString(), "FontStyle", writer);
     }
     if (this.fontWeightSet)
     {
         Serializer.SerializeObj(StyleInfo.GetFontWeightString(this.fontWeight), "FontWeight", writer);
     }
     if (this.leftBorderSet && (this.leftBorder != null))
     {
         Serializer.SerializeObj(this.leftBorder, "LeftBorder", writer);
     }
     if (this.topBorderSet && (this.topBorder != null))
     {
         Serializer.SerializeObj(this.topBorder, "TopBorder", writer);
     }
     if (this.rightBorderSet && (this.rightBorder != null))
     {
         Serializer.SerializeObj(this.rightBorder, "RightBorder", writer);
     }
     if (this.bottomBorderSet && (this.bottomBorder != null))
     {
         Serializer.SerializeObj(this.bottomBorder, "BottomBorder", writer);
     }
     if (this.horizontalBorderSet && (this.horizontalBorder != null))
     {
         Serializer.SerializeObj(this.horizontalBorder, "HorizontalBorder", writer);
     }
     if (this.verticalBorderSet && (this.verticalBorder != null))
     {
         Serializer.SerializeObj(this.verticalBorder, "VerticalBorder", writer);
     }
     if (this.backgroundSet && (this.background != null))
     {
         Serializer.SerializeObj(this.background, "Background", writer);
     }
     if (this.foregroundSet && (this.foreground != null))
     {
         Serializer.SerializeObj(this.foreground, "Foreground", writer);
     }
     if (this.backgroundThemeColorSet && (this.backgroundThemeColor != null))
     {
         Serializer.SerializeObj(this.backgroundThemeColor, "BackgroundTheme", writer);
     }
     if (this.foregroundThemeColorSet && (this.foregroundThemeColor != null))
     {
         Serializer.SerializeObj(this.foregroundThemeColor, "ForegroundTheme", writer);
     }
 }
示例#2
0
 /// <summary>
 /// Converts an object into its XML representation.
 /// </summary>
 /// <param name="writer">The <see cref="T:System.Xml.XmlWriter" /> stream to which the object is serialized.</param>
 void IXmlSerializable.WriteXml(XmlWriter writer)
 {
     Serializer.InitWriter(writer);
     if (this._fontThemeSet)
     {
         Serializer.SerializeObj(this._fontTheme, "FontTheme", writer);
     }
     if (this._fontFamilySet)
     {
         if (this._fontFamily == null)
         {
             writer.WriteStartElement("FontFamily");
             Serializer.WriteAttr("value", Serializer.Format(null), writer);
             writer.WriteEndElement();
         }
         else
         {
             Serializer.SerializeObj(this._fontFamily.Source, "FontFamily", writer);
         }
     }
     if (this._fontSizeSet)
     {
         Serializer.SerializeObj((double)this._fontSize, "FontSize", writer);
     }
     if (this._fontStretchSet)
     {
         Serializer.SerializeObj(this._fontStretch.ToString(), "FontStretch", writer);
     }
     if (this._fontStyleSet)
     {
         Serializer.SerializeObj(this._fontStyle.ToString(), "FontStyle", writer);
     }
     if (this._fontWeightSet)
     {
         Serializer.SerializeObj(StyleInfo.GetFontWeightString(this._fontWeight), "FontWeight", writer);
     }
     if (this._fillSet)
     {
         Serializer.SerializeObj(this._fill, "Fill", writer);
     }
     if (this._foregroundSet)
     {
         Serializer.SerializeObj(this._foreground, "Foreground", writer);
     }
     if (this._fillThemeColorSet)
     {
         Serializer.SerializeObj(this._fillThemeColor, "FillTheme", writer);
     }
     if (this._foregroundThemeColorSet)
     {
         Serializer.SerializeObj(this._foregroundThemeColor, "ForegroundTheme", writer);
     }
     if (this._strokeSet)
     {
         Serializer.SerializeObj(this._stroke, "Stroke", writer);
     }
     if (this._strokeThemeColorSet)
     {
         Serializer.SerializeObj(this._strokeThemeColor, "StrokeTheme", writer);
     }
     if (this._strokeThicknessSet)
     {
         Serializer.SerializeObj((double)this._strokeThickness, "StrokeThickness", writer);
     }
     if (this._cornerRadiusSet)
     {
         Serializer.SerializeObj((double)this._cornerRadius, "CornerRadius", writer);
     }
     if (this._strokeDashTypeSet && (this._strokeDashType != Dt.Cells.Data.StrokeDashType.None))
     {
         Serializer.SerializeObj(this._strokeDashType, "StrokeDashes", writer);
     }
     if (this._formatterSet)
     {
         if (this._formatter == null)
         {
             writer.WriteStartElement("Formatter");
             Serializer.WriteAttr("value", Serializer.Format(null), writer);
             writer.WriteEndElement();
         }
         else
         {
             Serializer.SerializeObj(this._formatter.FormatString, "Formatter", writer);
         }
     }
     if (this._lineCapTypeSet)
     {
         Serializer.SerializeObj(this._lineCapType, "LineCapType", writer);
     }
     if (this._lineJoinTypeSet)
     {
         Serializer.SerializeObj(this._lineJoinType, "LineJoinType", writer);
     }
     if (this._lineBeginArrowSettingsSet && (this._lineBeginArrowSettings != null))
     {
         Serializer.SerializeObj(this._lineBeginArrowSettings, "LineBeginArrowSettings", writer);
     }
     if (this._lineEndArrowSettingsSet && (this._lineEndArrowSettings != null))
     {
         Serializer.SerializeObj(this._lineEndArrowSettings, "LineEndArrowSettings", writer);
     }
 }