Esempio n. 1
0
        /// <summary>
        /// 重新加载
        /// </summary>
        /// <param name="session"></param>
        /// <returns></returns>
        public static bool ReloadOperator(ISession session)
        {
            var data = GetOperators(session);

            if (data == null)
            {
                return(false);
            }

            lock (operlockobject)
            {
                AddinCache.ClearAllOpers();
                data.ToList().ForEach(p => { AddinCache.AddOper(p); });
            }
            return(true);
        }
Esempio n. 2
0
 /// <summary>
 /// 初始化加载二开操作员
 /// </summary>
 /// <param name="session"></param>
 /// <returns></returns>
 public static void Init(ISession session)
 {
     if (_inited)
     {
         return;
     }
     lock (lockobject)
     {
         if (_inited)
         {
             return;
         }
         //操作员
         var operators = GetOperators(session);
         if (operators == null)
         {
             return;
         }
         operators.ToList().ForEach(p => { AddinCache.AddOper(p); });
         _inited = true; //设置初始化完成标志
     }
 }