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; } }
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); } }
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); }
public virtual void OnEnter(ViewParam openParam) { int subViewCount = listSubView == null ? 0 : listSubView.Count; for (int i = 0; i < subViewCount; ++i) { listSubView[i].OnEnter(openParam); } }
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; } }