コード例 #1
0
    public override object SetObjectData(object obj,System.Runtime.Serialization.SerializationInfo info,System.Runtime.Serialization.StreamingContext context,System.Runtime.Serialization.ISurrogateSelector selector)
    {
      base.SetObjectData(obj, info, context, selector);

      _text = info.GetString("Text");
      _font = (Font)info.GetValue("Font", typeof(Font));
      _textBrush = (BrushX)info.GetValue("Brush", typeof(BrushX));
      _background = (IBackgroundStyle)info.GetValue("BackgroundStyle", typeof(IBackgroundStyle));
      _lineSpacingFactor = info.GetSingle("LineSpacing");
      _xAnchorType = (XAnchorPositionType)info.GetValue("XAnchor", typeof(XAnchorPositionType));
      _yAnchorType = (YAnchorPositionType)info.GetValue("YAnchor", typeof(YAnchorPositionType));
      return this;
    }
コード例 #2
0
    protected override void CopyFrom(GraphicBase bfrom)
    {
      TextGraphic from = bfrom as TextGraphic;
      if (from != null)
      {
        this._text = from._text;
        this._font = from._font == null ? null : (Font)from._font.Clone();
        this._textBrush = from._textBrush == null ? null : (BrushX)from._textBrush.Clone();
        this._background = from._background == null ? null : (IBackgroundStyle)from._background.Clone();
        this._lineSpacingFactor = from._lineSpacingFactor;
        _xAnchorType = from._xAnchorType;
        _yAnchorType = from._yAnchorType;

        // don't clone the cached items
        this._cachedTextLines = null;
        this._isStructureInSync = false;
        this._isMeasureInSync = false;
      }
      base.CopyFrom(bfrom);
    }