Exemplo n.º 1
0
 /// <summary>
 /// 查找一个视图层
 /// </summary>
 /// <param name="_uuid"> 视图层唯一识别码</param>
 /// <returns>找到的视图层</returns>
 protected View findView(string _uuid)
 {
     View.Inner inner = board_.getViewCenter().FindUnit(_uuid);
     if (null == inner)
     {
         return(null);
     }
     return(inner.getUnit());
 }
Exemplo n.º 2
0
 /// <summary>删除视图层</summary>
 /// <param name="_uuid">视图层唯一识别码</param>
 /// <returns>错误</returns>
 public Error PopView(string _uuid)
 {
     View.Inner inner = board_.getViewCenter().FindUnit(_uuid);
     if (null == inner)
     {
         return(Error.NewAccessErr("view {0} not found", _uuid));
     }
     inner.Dismantle();
     return(board_.getViewCenter().Cancel(_uuid));
 }
Exemplo n.º 3
0
 public Error Register(string _uuid, View.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.º 4
0
        /// <summary>添加视图层</summary>
        /// <param name="_uuid">视图层唯一识别码</param>
        /// <param name="_view">视图层实列</param>
        /// <returns>错误</returns>
        public Error PushView(string _uuid, View _view)
        {
            View.Inner inner = new View.Inner(_view);
            Error      err   = board_.getViewCenter().Register(_uuid, inner);

            if (!Error.IsOK(err))
            {
                return(err);
            }
            inner.Setup(board_);
            return(Error.OK);
        }
Exemplo n.º 5
0
 /// <summary>注册视图层</summary>
 /// <param name="_uuid">视图层唯一识别码</param>
 /// <param name="_model">视图层实例</param>
 /// <returns>错误</returns>
 public Error RegisterView(string _uuid, View _view)
 {
     View.Inner inner = new View.Inner(_view);
     return(board_.viewCenter.Register(_uuid, inner));
 }
Exemplo n.º 6
0
 public View.Inner FindUnit(string _uuid)
 {
     View.Inner inner = null;
     units_.TryGetValue(_uuid, out inner);
     return(inner);
 }