private void ShowSelectedLevelPage(TestLevel level) { var levelPage = m_levelPage.FirstOrDefault(x => x.Level == level); if (levelPage == null) { switch (level) { case TestLevel.CLevelA: levelPage = new LevelA(); break; case TestLevel.CLevelB: levelPage = new LevelB(); break; case TestLevel.CLevelC: levelPage = new LevelC(); break; case TestLevel.CLevelB1: levelPage = new LevelB1(); break; case TestLevel.CLevelB2: levelPage = new LevelB2(); break; case TestLevel.GLevelA: case TestLevel.GLevelB: case TestLevel.GLevelC: case TestLevel.GLevelB1: case TestLevel.GLevelB2: levelPage = new GenerateList(level, false); break; case TestLevel.GcLevelA: case TestLevel.GcLevelB: case TestLevel.GcLevelC: case TestLevel.GcLevelB1: case TestLevel.GcLevelB2: levelPage = new GenerateList(level, true); break; case TestLevel.SAudioFilePath: levelPage = new ConfigAudioFilePath(); break; case TestLevel.SB1B2: levelPage = new ConfigTestB1B2(); break; } m_levelPage.Add(levelPage); } pageTransition.ShowPage(levelPage as UserControl); }
public static Grade GetGrade(int score) { Grade grade = null; if (score >= 90) { grade = new LevelA(); } else if (score >= 80 && score < 90) { grade = new LevelB(); } else if (score >= 70 && score < 80) { grade = new LevelC(); } else { grade = new LevelD(); } return(grade); }