/// <summary> /// 删除锁 /// </summary> public void DeleteLock() { SCLock lockData = this._Lock; if (lockData == null) { lockData = SCLock.CreateDefaultDataOperationLock(); } SCLockAdapter.Instance.DeleteLock(lockData); this._Lock = null; }
/// <summary> /// 延长锁的时间 /// </summary> public void ExtendLock() { SCLock lockData = this._Lock; if (lockData == null) { lockData = SCLock.CreateDefaultDataOperationLock(); } SCCheckLockResult checkResult = SCLockAdapter.Instance.ExtendLockTime(lockData); this._Lock = checkResult.Lock; }
public void AddLock(TimeSpan effectiveTime, string description) { SCLock lockData = SCLock.CreateDefaultDataOperationLock(); lockData.EffectiveTime = effectiveTime; lockData.Description = description; SCCheckLockResult checkResult = SCLockAdapter.Instance.AddLock(lockData); if (checkResult.Available == false) { throw new SCCheckLockException(SCCheckLockException.CheckLockResultToMessage(checkResult)); } this._Lock = checkResult.Lock; }