Пример #1
0
        private static LockStatus GetConflictingLocks(LockStatus affactingLocks, LockShareMode shareMode)
        {
            if (shareMode == LockShareMode.Exclusive)
            {
                return(affactingLocks);
            }

            return(new LockStatus(
                       affactingLocks
                       .ReferenceLocks
                       .Where(x => LockShareMode.Parse(x.ShareMode) == LockShareMode.Exclusive)
                       .ToList(),
                       affactingLocks
                       .ParentLocks
                       .Where(x => LockShareMode.Parse(x.ShareMode) == LockShareMode.Exclusive)
                       .ToList(),
                       affactingLocks
                       .ChildLocks
                       .Where(x => LockShareMode.Parse(x.ShareMode) == LockShareMode.Exclusive)
                       .ToList()));
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LockResult"/> class.
 /// </summary>
 /// <param name="conflictingLocks">The collection of locks preventing locking the given destination</param>
 public LockResult(LockStatus conflictingLocks)
 {
     ConflictingLocks = conflictingLocks;
 }