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); } }
/// <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); } }
public static extern int SystemParametersInfo(UAction uAction, int uParam, StringBuilder lpvParam, int fuWinIni);
SystemParametersInfo(UAction uAction, int uParam, StringBuilder lpvParam, int fuWinIni);