public static Page GetPage(EPageType pageType) { Page page = CreatePage(pageType); page.DataContext = CreatePageViewModel(pageType); return(page); }
public void NavigateTo(EPageType pageType, Object data = null) { Page page = CPagesStore.Instance.GetPageByType(pageType); ViewModelInitialize(page, data); _navigationItems.Push(new CNavigationHistoryItem(pageType, data)); PageNavigate?.Invoke(this, page); }
static int IntToEnum(IntPtr L) { int arg0 = (int)LuaDLL.lua_tonumber(L, 1); EPageType o = (EPageType)arg0; ToLua.Push(L, o); return(1); }
protected void AnchorUIGameObject() { if (XPageRoot.Instance == null || m_pageInst == null) { return; } GameObject ui = m_pageInst; //check if this is ugui or (ngui)? Vector3 anchorPos = Vector3.zero; Vector2 sizeDel = Vector2.zero; Vector3 scale = Vector3.one; if (ui.GetComponent <RectTransform>() != null) { anchorPos = ui.GetComponent <RectTransform>().anchoredPosition; sizeDel = ui.GetComponent <RectTransform>().sizeDelta; scale = ui.GetComponent <RectTransform>().localScale; } else { anchorPos = ui.transform.localPosition; scale = ui.transform.localScale; } EPageType type = this.m_pageType; if (type == EPageType.Normal) { ui.transform.SetParent(XPageRoot.Instance.normalRoot); } else if (type == EPageType.PopUp) { ui.transform.SetParent(XPageRoot.Instance.popupRoot); } else if (type == EPageType.Fixed) { ui.transform.SetParent(XPageRoot.Instance.fixedRoot); } //else if (type == EPageType.Toppest) //{ // ui.transform.SetParent(XPageRoot.Instance.ToppestRoot); //} if (ui.GetComponent <RectTransform>() != null) { ui.GetComponent <RectTransform>().anchoredPosition = anchorPos; ui.GetComponent <RectTransform>().sizeDelta = sizeDel; ui.GetComponent <RectTransform>().localScale = scale; } else { ui.transform.localPosition = anchorPos; ui.transform.localScale = scale; } }
private static ViewModelBase CreatePageViewModel(EPageType pageType) { switch (pageType) { case EPageType.SignIn: return(new LoginPageViewModel()); default: return(new ViewModelBase()); } }
void PlayMusic(EPageType rType) { //音乐控制 music control if (rType == EPageType.StartPage) { AudioManager.Instance.PlayMusic1(); } else { AudioManager.Instance.PlayMusic2(); } }
public void InitData(EPageType type) { DataSet _ds = new BCW.MobileSlider.BLL.MobileSlider().GetList("ptype=" + ( int )type); for (int i = 0; i < _ds.Tables[0].Rows.Count; i++) { sliderPicItem _item = new sliderPicItem(); _item.url = "http://" + Utils.GetDomain() + _ds.Tables[0].Rows[i]["url"].ToString(); _item.content_type = _ds.Tables[0].Rows[i]["contentType"].ToString(); _item.arryParams = _ds.Tables[0].Rows[i]["param"].ToString().Split('|'); items.Add(_item); } }
private static string SetActionName(EPageType pageType) { switch (pageType) { case EPageType.CategoriesList: return "Category"; case EPageType.TagsList: return "Tag"; case EPageType.SearchStringList: return "Search"; } return "Posts"; }
private static Page CreatePage(EPageType pageType) { switch (pageType) { case EPageType.SignIn: return(new LoginPage()); case EPageType.Main: return(new MainPage()); default: return(new Page()); } }
/// <summary> /// 减小Normal类型的界面显示序号 /// </summary> /// <returns></returns> public int SubOrder(EPageType pageType) { switch (pageType) { case EPageType.Normal: normalOrder = (int)Mathf.Clamp(normalOrder - offsetOrder, normalRange.x, normalRange.y); return(normalOrder); case EPageType.PopUp: popupOrder = (int)Mathf.Clamp(popupOrder - offsetOrder, popupRange.x, popupRange.y); return(popupOrder); } Debug.LogError("固定类型的页界,不进行深度自动排序"); return(0); }
public static List <UIPage> Show(EPageType aPage, bool aShow) { if (PagesRefs.ContainsKey(aPage)) { foreach (UIPage page in PagesRefs[aPage]) { page.Show(aShow); } return(PagesRefs[aPage]); } else { Debug.LogError("There is no " + aPage + " registered in UI Manager. Make sure it is registering itself."); } return(new List <UIPage>()); }
static int get_m_pageType(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); XPage obj = (XPage)o; EPageType ret = obj.m_pageType; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index m_pageType on a nil value" : e.Message)); } }
static int SetPage(IntPtr L) { try { ToLua.CheckArgsCount(L, 4); UIPage obj = (UIPage)ToLua.CheckObject(L, 1, typeof(UIPage)); EPageType arg0 = (EPageType)ToLua.CheckObject(L, 2, typeof(EPageType)); EShowMode arg1 = (EShowMode)ToLua.CheckObject(L, 3, typeof(EShowMode)); ECollider arg2 = (ECollider)ToLua.CheckObject(L, 4, typeof(ECollider)); obj.SetPage(arg0, arg1, arg2); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// 获得对应Page类型的Root /// </summary> /// <param name="type"></param> /// <returns></returns> public Transform GetRoot(EPageType type) { if (type == EPageType.Fixed) { return(fixedRoot); } if (type == EPageType.Normal) { return(normalRoot); } if (type == EPageType.PopUp) { return(popupRoot); } return(root); }
internal Page(string id, string name, EPageType type) { if (string.IsNullOrWhiteSpace(id)) { throw new ArgumentNullException(nameof(id), "You must specify an ID"); } if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException(nameof(name), "You must specify a name for each page"); } Id = id; Name = name; Type = type; _views = new List <AbstractView>(); }
static int set_m_pageType(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); XPage obj = (XPage)o; EPageType arg0 = (EPageType)ToLua.CheckObject(L, 2, typeof(EPageType)); obj.m_pageType = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index m_pageType on a nil value" : e.Message)); } }
private static List<object> SetRouteValues(EPageType pageType, string routeValue, int currentPage) { if (pageType == EPageType.SearchStringList) { return new List<object> { new {searchString = routeValue, page = 2}, new {searchString = routeValue, page = currentPage - 1}, new {searchString = routeValue, page = currentPage - 1}, new {searchString = routeValue, page = currentPage + 1} }; } return new List<object> { new {page = 2}, new {page = currentPage - 1}, new {page = currentPage - 1}, new {page = currentPage + 1} }; }
public GameObject OpenPage(EPageType rType, bool rIsActive = true) { GameObject go = null; switch (rType) { case EPageType.StartPage: go = Instantiate(Resources.Load <GameObject>("UI/StartPage_1"), mParent); break; case EPageType.IntroductionPage: go = Instantiate(Resources.Load <GameObject>("UI/IntroductionPage_2"), mParent); break; case EPageType.LineUpPage: go = Instantiate(Resources.Load <GameObject>("UI/LineUpPage_3"), mParent); break; case EPageType.AchievementPage: go = Instantiate(Resources.Load <GameObject>("UI/AchievementPage_4"), mParent); break; case EPageType.IntroductionPage5: go = Instantiate(Resources.Load <GameObject>("UI/IntroductionPage_5"), mParent); break; case EPageType.ResaurantsPage: go = Instantiate(Resources.Load <GameObject>("UI/RestaurantsPage_6"), mParent); break; case EPageType.Animation_Spread: go = Instantiate(Resources.Load <GameObject>("UI/AnimationPage1_Spread"), mParent); break; case EPageType.Animation_Method: go = Instantiate(Resources.Load <GameObject>("UI/AnimationPage1_Method"), mParent); break; case EPageType.Animation_FeverVoming: go = Instantiate(Resources.Load <GameObject>("UI/AnimationPage1_Fever&vomiting"), mParent); break; default: go = Instantiate(Resources.Load <GameObject>("UI/StartPage_1"), mParent); break; } //go.transform.parent = mParent; go.transform.localScale = Vector3.one; go.transform.localPosition = Vector3.zero; if (rIsActive == false) { foreach (var item in mStack) { item.gameObject.SetActive(false); } } mStack.Push(go.GetComponent <BasePage>()); PlayMusic(rType); return(go); }
public NavigateEventArgs(EPageType pageType, Object data = null) { PageType = pageType; Data = data; }
private Page GetPage(EPageType pageType) { return(CPagesFactory.GetPage(pageType)); }
public Page GetPageByType(EPageType pageType) { return(_pages[pageType]); }
/// <summary> /// 设置界面显示配置属性 /// </summary> /// <param name="type">类型</param> /// <param name="mode">显示模式</param> /// <param name="collider">碰撞模式</param> public void SetPage(EPageType type, EShowMode mode, ECollider collider) { context.pageType = type; context.showMode = mode; context.collider = collider; }
public CNavigationHistoryItem(EPageType pageType, object data) { PageType = pageType; Data = data; }