Ejemplo n.º 1
0
        public void Open(ViewParam param)
        {
            switch (m_eStatus)
            {
            case ViewStatus.None:
                m_cOpenParam.Copy(param);
                m_eOpStatus = ViewOptype.Open;
                this.DoInit();
                break;

            case ViewStatus.Initing:
                m_cOpenParam.Copy(param);
                m_eOpStatus = ViewOptype.Open;
                break;

            case ViewStatus.Open:
                //m_eOpStatus = ViewOptype.None;
                //DoOpen();
                break;

            case ViewStatus.Openning:
                m_eOpStatus = ViewOptype.None;
                break;

            case ViewStatus.Close:
                m_eOpStatus = ViewOptype.None;
                m_cOpenParam.Copy(param);
                this.DoOpen();
                break;

            case ViewStatus.Closing:
                m_eOpStatus = ViewOptype.Open;
                break;
            }
        }
Ejemplo n.º 2
0
 public void Open(string name, ViewParam param = null)
 {
     if (!_views.ContainsKey(name))
     {
         string clsName = name + "Controller";
         Type   type    = Type.GetType(clsName);
         if (type == null)
         {
             type = typeof(BaseViewController);
         }
         object obj = Activator.CreateInstance(type);
         if (obj == null)
         {
             CLog.LogError("Cannot find class with type [" + type + "].");
             return;
         }
         BaseViewController controller = obj as BaseViewController;
         controller.viewName = name;
         controller.viewPath = GetViewPath(name);
         //_views.Add(name, controller);
         m_cContainer.Add(controller, param);
     }
     else
     {
         _views[name].Open(param);
     }
 }
Ejemplo n.º 3
0
        private void OnAdd(IDynamicObj obj, object param)
        {
            BaseViewController controller = obj as BaseViewController;
            ViewParam          p          = param as ViewParam;

            _views.Add(controller.viewName, controller);
            controller.Open(p);
        }
Ejemplo n.º 4
0
        public virtual void OnEnter(ViewParam openParam)
        {
            int subViewCount = listSubView == null ? 0 : listSubView.Count;

            for (int i = 0; i < subViewCount; ++i)
            {
                listSubView[i].OnEnter(openParam);
            }
        }
Ejemplo n.º 5
0
 public void Copy(ViewParam param)
 {
     if (param == null)
     {
         this.intParam      = -1;
         this.strParam      = null;
         this.objParam      = null;
         this.callbackParam = null;
     }
     else
     {
         this.intParam      = param.intParam;
         this.strParam      = param.strParam;
         this.objParam      = param.objParam;
         this.callbackParam = param.callbackParam;
     }
 }