public override void ReadExternal(IMemento memento, ExternalizeContext context)
 {
     base.ReadExternal(memento, context);
     _angle = memento.ReadFloat("Angle");
     _isFlippedHorizontal = memento.ReadBool("IsFlippedHorizontal");
     _isFlippedVertical   = memento.ReadBool("IsFlippedVertical");
 }
Exemple #2
0
        public override void ReadExternal(IMemento memento, ExternalizeContext context)
        {
            base.ReadExternal(memento, context);

            _font                = (FontDescription)memento.ReadSerializable("Font");
            _fontColor           = (Color)memento.ReadSerializable("FontColor");
            _foreground          = (Color)memento.ReadSerializable("Foreground");
            _background          = (IBrushDescription)memento.ReadSerializable("Background");
            _isForegroundEnabled = memento.ReadBool("IsForegroundEnabled");
            _isBackgroundEnabled = memento.ReadBool("IsBackgroundEnabled");
            _borderWidth         = memento.ReadInt("BorderWidth");
            _borderDashStyle     = (DashStyle)memento.ReadSerializable("BorderDashStyle");
            _minSize             = (Size)memento.ReadSerializable("MinSize");
            _maxSize             = (Size)memento.ReadSerializable("MaxSize");
            _autoSize            = (AutoSizeKinds)memento.ReadSerializable("AutoSize");

            _padding = (Insets)memento.ReadSerializable("Padding");

            _selectionBorderColor = (Color)memento.ReadSerializable("SelectionBorderColor");
            _selectionBrush       = (IBrushDescription)memento.ReadSerializable("SelectionBrush");
            StyledText            = (StyledText)memento.ReadSerializable("StyledText");

            _text = memento.ReadString("Text");
            _textHorizontalAlignment =
                (DataType::HorizontalAlignment)memento.ReadSerializable("TextHorizontalAlignment");
            _textVerticalAlignment =
                (VerticalAlignment)memento.ReadSerializable("TextVerticalAlignment");
        }
Exemple #3
0
        public override void ReadExternal(IMemento memento, ExternalizeContext context)
        {
            base.ReadExternal(memento, context);

            _imageDesc = memento.ReadSerializable("ImageDesc") as IImageDescription;

            _imageSize = (Size)memento.ReadSerializable("ImageSize");
            _opacity   = memento.ReadFloat("Opacity");
            _needRecreateImageOnBoundsChanged = memento.ReadBool("NeedRecreateImageOnBoundsChanged");
            _needImageFitted = memento.ReadBool("NeedImageFitted");
        }
Exemple #4
0
        public override void ReadExternal(IMemento memento, ExternalizeContext context)
        {
            base.ReadExternal(memento, context);

            _isVertical      = memento.ReadBool("IsVertical");
            _headLengthRatio = memento.ReadFloat("HeadLengthRatio");
            _shaftWidthRatio = memento.ReadFloat("ShaftWidthRatio");
        }
Exemple #5
0
        public override void ReadExternal(IMemento memento, ExternalizeContext context)
        {
            base.ReadExternal(memento, context);

            _isNotEqual        = memento.ReadBool("IsNotEqual");
            _widthRatio        = memento.ReadFloat("WidthRatio");
            _marginRatio       = memento.ReadFloat("MarginRatio");
            _strikeMarginRatio = memento.ReadFloat("StrikeRatio");
        }
        public virtual void ReadExternal(IMemento memento, ExternalizeContext context)
        {
            _isVisible = memento.ReadBool("IsVisible");
            _layout    = memento.ReadExternalizable("Layout") as ILayout;
            if (_layout != null)
            {
                _layout.Owner = this;
            }
            if (memento.Contains("LayoutConstraints"))
            {
                var constraints = memento.ReadSerializable("LayoutConstraints") as Dictionary <IMemento, object>;
                if (constraints.Count > 0)
                {
                    foreach (var pair in constraints)
                    {
                        var child = context.GetExternalizable("Children", pair.Key) as IFigure;
                        LayoutConstraints[child] = pair.Value;
                    }
                }
            }
            if (memento.Contains("PersistentData"))
            {
                var data = memento.ReadSerializable("PersistentData") as Dictionary <string, object>;
                if (data.Count > 0)
                {
                    foreach (var pair in data)
                    {
                        PersistentData[pair.Key] = pair.Value;
                    }
                }
            }

            if (memento.Contains("Children"))
            {
                var children = memento.ReadExternalizables("Children");
                foreach (var child in children)
                {
                    var childFig = child as IFigure;
                    if (childFig != null)
                    {
                        Children.Add(childFig);
                    }
                }
            }
        }