示例#1
0
        static public bool ReleasePersistentLockWithRetry(string assetFullName)
        {
SourceLockRelease:
            // Try to release the lock
            if (!MOG_ControllerProject.PersistentLock_Release(assetFullName))
            {
                // If we can't, tell us who has it
                MOG_Command sourceLock = MOG_ControllerProject.PersistentLock_Query(assetFullName);

                lockHolder = sourceLock.GetCommand();
                if (sourceLock.IsCompleted() &&
                    lockHolder != null)
                {
                    // Now check if someone had a lock on this asset
                    switch (LockMessage("This asset is currently locked by another user", sourceLock, lockHolder))
                    {
                    case DialogResult.Retry:
                        goto SourceLockRelease;
                    }

                    return(false);
                }
            }

            return(true);
        }