Exemplo n.º 1
0
        /// <summary>
        /// 删除锁
        /// </summary>
        public void DeleteLock()
        {
            DELock lockData = this._Lock;

            if (lockData == null)
            {
                lockData = DELock.CreateDefaultDataOperationLock();
            }

            DELockAdapter.Instance.DeleteLock(lockData);
            this._Lock = null;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 延长锁的时间
        /// </summary>
        public void ExtendLock()
        {
            DELock lockData = this._Lock;

            if (lockData == null)
            {
                lockData = DELock.CreateDefaultDataOperationLock();
            }

            DECheckLockResult checkResult = DELockAdapter.Instance.ExtendLockTime(lockData);

            this._Lock = checkResult.Lock;
        }
Exemplo n.º 3
0
        public void AddLock(TimeSpan effectiveTime, string description)
        {
            DELock lockData = DELock.CreateDefaultDataOperationLock();

            lockData.EffectiveTime = effectiveTime;
            lockData.Description   = description;

            DECheckLockResult checkResult = DELockAdapter.Instance.AddLock(lockData);

            if (checkResult.Available == false)
            {
                throw new DECheckLockException(DECheckLockException.CheckLockResultToMessage(checkResult));
            }

            this._Lock = checkResult.Lock;
        }