// ========================================
 // constructor
 // ========================================
 public MemoTableFrameHandleFigure()
 {
     _borderWidth   = 4;
     _moveBarHeight = 12;
     _cornerWidth   = 8;
     Foreground     = Color.DarkGray;
     Background     = new SolidBrushDescription(Color.WhiteSmoke);
 }
예제 #2
0
        protected void SetShapeColorBase(Color color)
        {
            if (_EditorCanvas == null)
            {
                return;
            }

            var background = default(IBrushDescription);

            if (color.A == 0 && color.R == 0 && color.G == 0 && color.B == 0)
            {
                background = null;
            }
            else
            {
                background = new SolidBrushDescription(color);
            }

            var editors = _EditorCanvas.SelectionManager.SelectedEditors;
            var cmd     = default(ICommand);

            foreach (var editor in editors)
            {
                if (editor.Model is MemoShape || editor.Model is MemoTableCell)
                {
                    if (cmd == null)
                    {
                        cmd = new SetNodeBackgroundCommand(editor, background);
                    }
                    else
                    {
                        cmd = cmd.Chain(new SetNodeBackgroundCommand(editor, background));
                    }
                }
            }
            if (cmd != null)
            {
                _EditorCanvas.CommandExecutor.Execute(cmd);
            }
        }