Ejemplo n.º 1
0
        protected void AddAction <THandler, UAction>() where THandler : class, IActionHandler <TAction> where UAction : class, IAction <TAction>
        {
            UAction  action  = _pool.Spwan <UAction>(_agent);
            THandler handler = _pool.Spwan <THandler>(_agent, this, action);

            if (!_actionHandlerDic.ContainsKey(handler.Label))
            {
                _actionHandlerDic.Add(handler.Label, handler);
            }
            else
            {
                DebugMsg.LogError("发现具有重复标签的Handler,标签为:" + handler.Label);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Start the async worker to call the callee.
 /// </summary>
 /// <param name="callee">function to call, callee must be of type void and take no argument.</param>
 /// <returns>Whether or not the operation has gone successful</returns>
 public bool RunAsyncWorker(UAction callee)
 {
     try
     {
         if (isInit)
         {
             isInit    = false;
             shouldRun = true;
             asyncWorker.RunWorkerAsync();
         }
         shouldRun = true;
         actToCall = callee;
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
 public static extern int SystemParametersInfo(UAction uAction, int uParam, StringBuilder lpvParam, int fuWinIni);
Ejemplo n.º 4
0
 SystemParametersInfo(UAction uAction, int uParam, StringBuilder lpvParam, int fuWinIni);