Beispiel #1
0
        public void LockIfPossible(IVdShape shape, Shape resizeNode, Point pos, TouchDevice touchDev)
        {
            var shapeFree       = shape.GetCursor() == null;
            var shapeLockedByUs = false;

            if (!shapeFree)
            {
                shapeLockedByUs = shape.GetCursor().OwnerId == _palette.GetOwnerId();
            }

            //this shape free and we don't have cursors
            if (shapeFree && _doc.VolatileCtx.LocalCursor == null)
            {
                //shape free, try lock it and schedule cursor approval continuation
                {
                    _cursorApproval.resizeNode = resizeNode;
                    _cursorApproval.pos        = pos;
                    _cursorApproval.td         = touchDev;
                    _modeMgr.Mode = ShapeInputMode.CursorApprovalExpected;
                }

                //take new local cursor
                _doc.VolatileCtx.BeginTakeShapeWithLocalCursor(shape.Id());
            }
            else if (shapeLockedByUs)
            {
                CaptureAndStartManip(shape, pos, resizeNode, touchDev);
            }
        }
Beispiel #2
0
 //we have editing permission if either shape is free or if shape is cursored by us
 private bool editingPermission(IVdShape sh)
 {
     var noPermission = sh.GetCursor() != null && sh.GetCursor().OwnerId != _palette.GetOwnerId();
     return !noPermission;
 }
Beispiel #3
0
        //we have editing permission if either shape is free or if shape is cursored by us
        private bool editingPermission(IVdShape sh)
        {
            var noPermission = sh.GetCursor() != null && sh.GetCursor().OwnerId != _palette.GetOwnerId();

            return(!noPermission);
        }
Beispiel #4
0
        public void LockIfPossible(IVdShape shape, Shape resizeNode, Point pos, TouchDevice touchDev)
        {
            var shapeFree = shape.GetCursor() == null;
            var shapeLockedByUs = false;
            if (!shapeFree)
                shapeLockedByUs = shape.GetCursor().OwnerId == _palette.GetOwnerId();

            //this shape free and we don't have cursors
            if (shapeFree && _doc.VolatileCtx.LocalCursor == null)
            {
                //shape free, try lock it and schedule cursor approval continuation
                {
                    _cursorApproval.resizeNode = resizeNode;
                    _cursorApproval.pos = pos;
                    _cursorApproval.td = touchDev;
                    _modeMgr.Mode = ShapeInputMode.CursorApprovalExpected;
                }

                //take new local cursor
                _doc.VolatileCtx.BeginTakeShapeWithLocalCursor(shape.Id());
            }
            else if (shapeLockedByUs)
            {
                CaptureAndStartManip(shape, pos, resizeNode, touchDev);
            }
        }