Exemplo n.º 1
0
        private static void SelectShape(ISelectShape action,
                                        IShapeSource shapeSource, bool undo)
        {
            switch (action.Type)
            {
            case SelectType.Deselect:
                if (undo)
                {
                    shapeSource.Select(action.ShapeIndex);
                }
                else
                {
                    shapeSource.Deselect();
                }
                break;

            case SelectType.Select:
                if (undo)
                {
                    shapeSource.Deselect();
                }
                else
                {
                    shapeSource.Select(action.ShapeIndex);
                }
                break;

            default:
                break;
            }
        }