Exemplo n.º 1
0
 public bool editingPermission(IServerVdShape sh, int owner)
 {
     if (sh.GetCursor() == null)
     {
         return(true);
     }
     else if (sh.GetCursor().OwnerId == owner)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 2
0
        public void RemoveShape(IServerVdShape sh)
        {
            if (sh.GetCursor() != null)
            {
                throw new InvalidOperationException("cannot remove shape locked by cursor!");
            }

            _shapeIdToShape.Remove(sh.Id());
        }
Exemplo n.º 3
0
        public void UnlockAndRemoveShape(IServerVdShape sh)
        {
            var curs = sh.GetCursor();

            if (curs != null)
            {
                UnlockShape(sh, curs.OwnerId);
            }
            RemoveShape(sh);
        }
Exemplo n.º 4
0
        //returns previously locked shape, caller should broadcast cursor free event if result != null
        public void LockShape(IServerVdShape sh, int owner)
        {
            if (sh.GetCursor() != null)
            {
                throw new InvalidOperationException("cannot lock locked shape");
            }

            var cursor = new ServerCursor(owner);

            sh.SetCursor(cursor);

            _userIdToCursor.Add(owner, sh);
        }
Exemplo n.º 5
0
 public bool editingPermission(IServerVdShape sh, int owner)
 {
     if (sh.GetCursor() == null)
         return true;
     else if (sh.GetCursor().OwnerId == owner)
         return true;
     else
         return false;
 }
Exemplo n.º 6
0
 public void UnlockAndRemoveShape(IServerVdShape sh)
 {
     var curs = sh.GetCursor();
     if (curs != null)
         UnlockShape(sh, curs.OwnerId);
     RemoveShape(sh);
 }
Exemplo n.º 7
0
        public void RemoveShape(IServerVdShape sh)
        {
            if (sh.GetCursor() != null)
                throw new InvalidOperationException("cannot remove shape locked by cursor!");

            _shapeIdToShape.Remove(sh.Id());
        }
Exemplo n.º 8
0
        //returns previously locked shape, caller should broadcast cursor free event if result != null
        public void LockShape(IServerVdShape sh, int owner)
        {
            if (sh.GetCursor() != null)
                throw new InvalidOperationException("cannot lock locked shape");

            var cursor = new ServerCursor(owner);
            sh.SetCursor(cursor);

            _userIdToCursor.Add(owner, sh);
        }