コード例 #1
0
        public override void ReadExternal(IMemento memento, ExternalizeContext context)
        {
            base.ReadExternal(memento, context);

            _router = (IRouter)memento.ReadExternalizable("Router");

            var edgePoints = (Point[])memento.ReadSerializable("EdgePoints");

            _edgePoints.Clear();
            for (int i = 0, len = edgePoints.Length; i < len; ++i)
            {
                _edgePoints.Add(edgePoints[i]);
            }
            _hitMargin        = memento.ReadInt("HitMargin");
            _lineColor        = (Color)memento.ReadSerializable("LineColor");
            _lineWidth        = memento.ReadInt("LineWidth");
            _lineDashStyle    = (DashStyle)memento.ReadSerializable("DashStyle");
            _connectionMethod = (ConnectionMethodKind)memento.ReadSerializable("ConnectionMethod");

            _sourceConnectionOption = memento.ReadSerializable("SourceConnectionOption");
            _targetConnectionOption = memento.ReadSerializable("TargetConnectionOption");

            {
                var opt = memento.ReadSerializable("EdgeBehaviorOptions") as EdgeBehaviorOptions;
                if (opt == null)
                {
                    _behaviorOptions = new EdgeBehaviorOptions();
                }
                else
                {
                    _behaviorOptions = opt;
                }
            }
        }
コード例 #2
0
        public static Bar LoadBar(IMemento mem, ExternalizeContext context)
        {
            var ret = new Bar();

            ret.Value = mem.ReadInt("Value");
            return(ret);
        }
コード例 #3
0
        public override void ReadExternal(IMemento memento, ExternalizeContext context)
        {
            base.ReadExternal(memento, context);

            _points    = memento.ReadSerializable("Points") as List <Point>;
            _hitMargin = memento.ReadInt("HitMargin");
        }
コード例 #4
0
ファイル: AbstractNode.cs プロジェクト: rajeshwarn/MochaNote
        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");
        }
コード例 #5
0
        public static Foo LoadFoo(IMemento mem, ExternalizeContext context)
        {
            var ret = new Foo();

            ret.Value = mem.ReadInt("Value");
            var barProxy = mem.ReadExternalizable("Bar") as BarProxy;

            ret.Bar = barProxy.Real;
            return(ret);
        }
コード例 #6
0
 public virtual void ReadExternal(IMemento memento, ExternalizeContext context)
 {
     _value = memento.ReadInt("Value");
     _foo   = memento.ReadExternalizable("Foo") as Foo;
 }
コード例 #7
0
 public virtual void ReadExternal(IMemento memento, ExternalizeContext context)
 {
     _value = memento.ReadInt("Value");
     _bar   = memento.ReadExternalizable("Bar") as Bar;
 }
コード例 #8
0
 public override void ReadExternal(IMemento memento, ExternalizeContext context)
 {
     base.ReadExternal(memento, context);
     _hitMargin  = memento.ReadInt("HitMargin");
     _cornerSize = (Size)memento.ReadSerializable("CornerSize");
 }
コード例 #9
0
 public void ReadExternal(IMemento memento, ExternalizeContext context)
 {
     _restoredParent      = context.ExtendedData[EditorConsts.RestoreEditorStructureParentModel] as MemoTable;
     _restoredRowIndex    = memento.ReadInt("RowIndex");
     _restoredColumnIndex = memento.ReadInt("ColumnIndex");
 }