/// <summary> /// 查找一个控制层 /// </summary> /// <param name="_uuid"> 控制层唯一识别码</param> /// <returns>找到的控制层</returns> protected Controller findController(string _uuid) { Controller.Inner inner = board_.controllerCenter.FindController(_uuid); if (null == inner) { return(null); } return(inner.controller); }
/// <summary> /// 查找一个控制层 /// </summary> /// <param name="_uuid"> 控制层唯一识别码</param> /// <returns>找到的控制层</returns> protected Controller findController(string _uuid) { Controller.Inner inner = board_.getControllerCenter().FindUnit(_uuid); if (null == inner) { return(null); } return(inner.getUnit()); }
/// <summary>删除控制层</summary> /// <param name="_uuid">控制层唯一识别码</param> /// <returns>错误</returns> public Error PopController(string _uuid) { Controller.Inner inner = board_.getControllerCenter().FindUnit(_uuid); if (null == inner) { return(Error.NewAccessErr("controller {0} not found", _uuid)); } inner.Dismantle(); return(board_.getControllerCenter().Cancel(_uuid)); }
public Error Register(string _uuid, Controller.Inner _inner) { board_.getLogger().Info("register {0}", _uuid); if (units_.ContainsKey(_uuid)) { return(Error.NewAccessErr("{0} exists", _uuid)); } units_[_uuid] = _inner; return(Error.OK); }
public Error Register(string _uuid, Controller.Inner _inner) { board_.logger.Info("register controller {0}", _uuid); if (controllers.ContainsKey(_uuid)) { return(Error.NewAccessErr("controller {0} exists", _uuid)); } controllers[_uuid] = _inner; return(Error.OK); }
/// <summary>添加控制层</summary> /// <param name="_uuid">控制层唯一识别码</param> /// <param name="_view">控制层实列</param> /// <returns>错误</returns> public Error PushController(string _uuid, Controller _controller) { Controller.Inner inner = new Controller.Inner(_controller); Error err = board_.getControllerCenter().Register(_uuid, inner); if (!Error.IsOK(err)) { return(err); } inner.Setup(board_); return(Error.OK); }
/// <summary>注册控制层</summary> /// <param name="_uuid">控制层唯一识别码</param> /// <param name="_model">控制层实例</param> /// <returns>错误</returns> public Error RegisterController(string _uuid, Controller _controller) { Controller.Inner inner = new Controller.Inner(_controller); return(board_.controllerCenter.Register(_uuid, inner)); }
public Controller.Inner FindUnit(string _uuid) { Controller.Inner inner = null; units_.TryGetValue(_uuid, out inner); return(inner); }
public Controller.Inner FindController(string _uuid) { Controller.Inner inner = null; controllers.TryGetValue(_uuid, out inner); return(inner); }