예제 #1
0
		public static SCLockSettings GetConfig()
		{
			SCLockSettings result = (SCLockSettings)ConfigurationBroker.GetSection("scLockSettings");

			if (result == null)
				result = new SCLockSettings();

			return result;
		}
예제 #2
0
        public static SCLockSettings GetConfig()
        {
            SCLockSettings result = (SCLockSettings)ConfigurationBroker.GetSection("scLockSettings");

            if (result == null)
            {
                result = new SCLockSettings();
            }

            return(result);
        }
예제 #3
0
        //public const string SynchronizationLockID = "0b3c3556-cef0-41a4-b84c-7f4ea2c4cffb";

        public SCLock()
        {
            this.EffectiveTime = SCLockSettings.GetConfig().DefaultEffectiveTime;
        }
 /// <summary>
 /// 执行需要延迟锁的操作,如果之前没有锁,则不延迟
 /// </summary>
 /// <param name="description"></param>
 /// <param name="action"></param>
 public void DoExtendLockAction(string description, Action action)
 {
     DoExtendLockAction(SCLockSettings.GetConfig().DefaultEffectiveTime, description, action);
 }
 /// <summary>
 /// 执行需要上锁的操作
 /// </summary>
 /// <param name="autoAddLock">是否自动加锁</param>
 /// <param name="description"></param>
 /// <param name="action"></param>
 public void DoAddLockAction(bool autoAddLock, string description, Action action)
 {
     DoAddLockAction(autoAddLock, SCLockSettings.GetConfig().DefaultEffectiveTime, description, action);
 }
 public void AddLock(string description)
 {
     AddLock(SCLockSettings.GetConfig().DefaultEffectiveTime, description);
 }