Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
 /// <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());
 }
Exemplo n.º 3
0
 /// <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));
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
        /// <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);
        }
Exemplo n.º 7
0
 /// <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));
 }
Exemplo n.º 8
0
 public Controller.Inner FindUnit(string _uuid)
 {
     Controller.Inner inner = null;
     units_.TryGetValue(_uuid, out inner);
     return(inner);
 }
Exemplo n.º 9
0
 public Controller.Inner FindController(string _uuid)
 {
     Controller.Inner inner = null;
     controllers.TryGetValue(_uuid, out inner);
     return(inner);
 }