예제 #1
0
        // ========================================
        // method
        // ========================================
        public override void WriteExternal(IMemento memento, ExternalizeContext context)
        {
            base.WriteExternal(memento, context);

            memento.WriteSerializable("Points", _points);
            memento.WriteInt("HitMargin", _hitMargin);
        }
예제 #2
0
        //protected FontCache _FontCache {
        //    get { return _fontCache; }
        //}

        //protected SizeCache _SizeCache {
        //    get { return _sizeCache; }
        //}

        //protected BoundsCache _BoundsCache {
        //    get { return _boundsCache; }
        //}

        //protected VisualLineCache _VisualLineCache {
        //    get { return _visualLineCache; }
        //}

        // ========================================
        // method
        // ========================================
        // === IPersistable ==========
        public override void WriteExternal(IMemento memento, ExternalizeContext context)
        {
            base.WriteExternal(memento, context);

            memento.WriteSerializable("Font", _font == null? null: _font.Clone());
            memento.WriteSerializable("FontColor", _fontColor);
            memento.WriteSerializable("Foreground", _foreground);
            memento.WriteSerializable("Background", _background == null? null: _background.Clone());
            memento.WriteBool("IsForegroundEnabled", _isForegroundEnabled);
            memento.WriteBool("IsBackgroundEnabled", _isBackgroundEnabled);
            memento.WriteInt("BorderWidth", _borderWidth);
            memento.WriteSerializable("BorderDashStyle", _borderDashStyle);
            memento.WriteSerializable("MinSize", _minSize);
            memento.WriteSerializable("MaxSize", _maxSize);
            memento.WriteSerializable("AutoSize", _autoSize);

            memento.WriteSerializable("Padding", _padding);

            memento.WriteSerializable("StyledText", _styledText == null? null: _styledText.CloneDeeply());
            memento.WriteSerializable("SelectionBorderColor", _selectionBorderColor);
            memento.WriteSerializable("SelectionBrush", _selectionBrush);

            memento.WriteString("Text", _text);
            memento.WriteSerializable("TextHorizontalAlignment", _textHorizontalAlignment);
            memento.WriteSerializable("TextVerticalAlignment", _textVerticalAlignment);
        }
예제 #3
0
 public static void SaveFoo(Foo foo, IMemento mem, ExternalizeContext context)
 {
     mem.WriteInt("Value", foo.Value);
     mem.WriteExternalizable(
         "Bar",
         new BarProxy(foo.Bar, SaveBar, LoadBar)
         );
 }
예제 #4
0
        // ========================================
        // method
        // ========================================
        // === IPersistable ==========
        public override void WriteExternal(IMemento memento, ExternalizeContext context)
        {
            base.WriteExternal(memento, context);

            memento.WriteExternalizable("Router", _router);

            memento.WriteSerializable("EdgePoints", _edgePoints.ToArray());
            memento.WriteInt("HitMargin", _hitMargin);
            memento.WriteSerializable("LineColor", _lineColor);
            memento.WriteInt("LineWidth", _lineWidth);
            memento.WriteSerializable("DashStyle", _lineDashStyle);
            memento.WriteSerializable("ConnectionMethod", _connectionMethod);

            memento.WriteSerializable("SourceConnectionOption", _sourceConnectionOption);
            memento.WriteSerializable("TargetConnectionOption", _targetConnectionOption);

            memento.WriteSerializable("EdgeBehaviorOptions", _behaviorOptions);
        }
예제 #5
0
            public void WriteExternal(IMemento memento, ExternalizeContext context)
            {
                var parentEditor = _editor.Parent;
                var table        = parentEditor.Model as MemoTable;
                var cell         = _editor.Model as MemoTableCell;

                for (int rowIndex = 0; rowIndex < table.RowCount; ++rowIndex)
                {
                    var row = table.Rows.ElementAt(rowIndex);
                    for (int colIndex = 0; colIndex < table.ColumnCount; ++colIndex)
                    {
                        var c = row.Cells.ElementAt(colIndex);
                        if (c == cell)
                        {
                            memento.WriteInt("RowIndex", rowIndex);
                            memento.WriteInt("ColumnIndex", colIndex);
                            break;
                        }
                    }
                }
            }
예제 #6
0
 public virtual void WriteExternal(IMemento memento, ExternalizeContext context)
 {
     memento.WriteInt("Value", _value);
     memento.WriteExternalizable("Foo", _foo);
 }
예제 #7
0
 public static void SaveBar(Bar bar, IMemento mem, ExternalizeContext context)
 {
     mem.WriteInt("Value", bar.Value);
 }
예제 #8
0
 public override void WriteExternal(IMemento memento, ExternalizeContext context)
 {
     base.WriteExternal(memento, context);
     memento.WriteInt("HitMargin", _hitMargin);
     memento.WriteSerializable("CornerSize", _cornerSize);
 }