private static string FavoritesSectionsConvertInString(FavoritesSections sections) { switch (sections) { case FavoritesSections.Group: return("Группы"); case FavoritesSections.Teather: return("Преподаватели"); default: throw new ArgumentOutOfRangeException( "Не удалось выбрать тип избранного. FavoritesSections = " + sections); } }
private void ShowSelectSections(FavoritesSections sections) { switch (sections) { case FavoritesSections.Group: List <Group> groups = Favorites.GetGroups(); InitSelect(groups, ShowScheduleFavoritesGroup, group => group.Info[0].Group.Value + group.TypeShedule.Value); break; case FavoritesSections.Teather: List <Teacher> teachers = Favorites.GetTeachers(); InitSelect(teachers, ShowScheduleFavoritesTeacher, teacher => teacher.Fio); break; default: throw new ArgumentOutOfRangeException( "Не удалось выбрать тип избранного. FavoritesSections = " + sections); } }