public CustomTabPage(PAGE_TYPE type) { page = null; switch (type) { case PAGE_TYPE.STUDENTS: page = new tabStudents(); break; case PAGE_TYPE.TEACHERS: page = new tabTeachers(); break; case PAGE_TYPE.DISCIPLINES: page = new tabDisciplines(); break; case PAGE_TYPE.GROUPS: page = new tabGroups(); break; } //NOTE: exception handler here if (page == null) { return; } currentPageType = type; page.Dock = DockStyle.Fill; this.Controls.Add(page); }
bool IsGraphPage(PAGE_TYPE pageType) { if (pageType == PAGE_TYPE.RECORD_BAR_GRAPH) { return(true); } if (pageType == PAGE_TYPE.RECORD_LINE_GRAPH) { return(true); } if (pageType == PAGE_TYPE.RECORD_NORMAL_DISTRIB) { return(true); } return(false); }
private void ChangePage(PAGE_TYPE type) { gridMainPage.Visibility = Visibility.Hidden; gridOneLuck.Visibility = Visibility.Hidden; gridMultipleLuck.Visibility = Visibility.Hidden; switch (type) { case PAGE_TYPE.PAGE_MAIN: gridMainPage.Visibility = Visibility.Visible; break; case PAGE_TYPE.PAGE_ONE: gridOneLuck.Visibility = Visibility.Visible; break; case PAGE_TYPE.PAGE_MULTIPLE: gridMultipleLuck.Visibility = Visibility.Visible; break; } }
private void GetResult(PAGE_TYPE type) { switch (type) { case PAGE_TYPE.PAGE_ONE: if (pageOneLuck.m_stop == false) { var listOne = m_memberManager.GetRandomMembers(pageOneLuck.m_luckSetting); pageOneLuck.Stop(listOne); } break; case PAGE_TYPE.PAGE_MULTIPLE: if (pageMultipleLuck.m_stop == false) { var list = m_memberManager.GetRandomMembers(pageMultipleLuck.m_luckSetting); pageMultipleLuck.Stop(list); } break; } }
void SetTitleTextAndEnableLineButton(PAGE_TYPE pageType, string titleTxt, string meterTxt, string dateText, bool enableLineButton) { if (!IsGraphPage(pageType)) { return; } GameObject tObj = _pageObj[(int)pageType].transform.Find("LittleTitle").gameObject; Text tTxt = tObj.GetComponent <Text>(); tTxt.text = titleTxt; GameObject mObj = _pageObj[(int)pageType].transform.Find("MeterTitle").gameObject; Text mTxt = mObj.GetComponent <Text>(); mTxt.text = meterTxt; GameObject dObj = _pageObj[(int)pageType].transform.Find("DateTitle").gameObject; Text dTxt = dObj.GetComponent <Text>(); dTxt.text = dateText; GameObject nObj = _pageObj[(int)pageType].transform.Find("LineButton").gameObject; nObj.SetActive(enableLineButton); }