Beispiel #1
0
 public List <BreadCrumb> GetPath(Func <BreadCrumb, bool> predicate, BreadCrumb parent)
 {
     foreach (var breadCrumb in parent.Children)
     {
         if (predicate(breadCrumb))
         {
             return new List <BreadCrumb> {
                        parent
             }
         }
         ;
         var result = GetPath(predicate, breadCrumb);
         if (result != null)
         {
             return(result.AddFluent(parent));
         }
     }
     return(null);
 }
Beispiel #2
0
 public static BreadCrumb GetBreadCrumbPart(HtmlHelper _helper)
 {
     if (root == null)
     {
         root = new BreadCrumb(typeof(MainPageVM),
                               HtmlControls.Anchor("/", "Главная").ToString()).Add(
             new BreadCrumb(typeof(ProfileVM),
                            _helper.Profile())
             .Add(
                 new BreadCrumb(typeof(EditProfileVM),
                                _helper.ActionLink <ProfileController>(
                                    c => c.EditProfile(), "Редактирование профиля").ToString()),
                 new BreadCrumb(typeof(ChangePasswordVM),
                                _helper.ActionLink <ProfileController>(
                                    c => c.ChangePassword(), "Сменить пароль").ToString()),
                 new BreadCrumb(typeof(SubscribesVM)),
                 new BreadCrumb(typeof(StudyTypeStatsVM)),
                 new BreadCrumb(typeof(UploadStudentPhotoVM)),
                 new BreadCrumb(typeof(CertificateListVM)),
                 new BreadCrumb(typeof(RealSpecialistVM)),
                 new BreadCrumb(typeof(WorkPlace)),
                 new BreadCrumb(typeof(GroupPhotosVM)),
                 new BreadCrumb(typeof(ClassmatesVM)),
                 new BreadCrumb(typeof(SeminarListVM)),
                 new BreadCrumb(typeof(SeminarCompleteVM)),
                 new BreadCrumb(typeof(AddSeminarVM)),
                 new BreadCrumb(typeof(PlanTestUserStatsVM)),
                 new BreadCrumb(typeof(PlanTestQuestionStatsVM)),
                 new BreadCrumb(typeof(LearningVM),
                                _helper.ActionLink <ProfileController>(
                                    c => c.Learning(), "Мои курсы").ToString())
                 .Add(
                     new BreadCrumb(typeof(GroupVM)),
                     new BreadCrumb(typeof(CoursePlannedTestVM))
                     ),
                 new BreadCrumb(typeof(EditExamQuestionnaireVM)),
                 new BreadCrumb(typeof(ChangeStatusVM)),
                 new BreadCrumb(typeof(FileListVM)),
                 new BreadCrumb(typeof(OrgGroupSearchVM)),
                 new BreadCrumb(typeof(OrgStudentVM)),
                 new BreadCrumb(typeof(OrgFileListVM)),
                 new BreadCrumb(typeof(OrgListVM)),
                 new BreadCrumb(typeof(OrgStatusUpdateVM)),
                 new BreadCrumb(typeof(OrgGroupVM)),
                 new BreadCrumb(typeof(OrgRealSpecialistVM)),
                 new BreadCrumb(typeof(TrainerCoursesVM)),
                 new BreadCrumb(typeof(TrainerGroupsVM)),
                 new BreadCrumb(typeof(EditSuccessStoryVM)),
                 new BreadCrumb(typeof(MyResponses)),
                 new BreadCrumb(typeof(LibraryVM)),
                 new BreadCrumb(typeof(MarketingActionsVM)),
                 new BreadCrumb(typeof(PrivateMessageListVM)),
                 new BreadCrumb(typeof(CompanyTestResultsVM)),
                 new BreadCrumb(typeof(TestEditVM)),
                 new BreadCrumb(typeof(TestReadOnlyVM)),
                 new BreadCrumb(typeof(CompanyTestsVM)),
                 new BreadCrumb(typeof(TestResultVM)),
                 new BreadCrumb(typeof(UserTestsVM), _helper.Url().UserTests().ToString()),
                 new BreadCrumb(typeof(TestCertificatesVM)),
                 new BreadCrumb(typeof(GroupInfosVM),
                                _helper.Url().GroupTests().ToString()).Add(new BreadCrumb(typeof(GroupInfoVM)),
                                                                           new BreadCrumb(typeof(GroupTestResultVM))),
                 new BreadCrumb(typeof(GroupPrepareVM)),
                 new BreadCrumb(typeof(TestListVM)),
                 new BreadCrumb(SimplePages.HostingInfo),
                 new BreadCrumb(typeof(CompetitionsVM),
                                _helper.ActionLink <CenterController>(
                                    c => c.Competitions(), "Конкурсы").ToString())
                 .Add(
                     new BreadCrumb(typeof(CompetitionVM))
                     ),
                 new BreadCrumb(typeof(CompanyFileListVM),
                                _helper.Url().CompanyFile().List("Файлы компаний").ToString()).Add(
                     new BreadCrumb(typeof(CompanyFileVM))
                     ),
                 new BreadCrumb(typeof(UserFileListVM),
                                _helper.ActionLink <FileController>(
                                    c => c.List(1), "Материалы преподавателя").ToString())
                 .Add(
                     new BreadCrumb(typeof(UserFileVM))
                     ),
                 new BreadCrumb(typeof(UserExamQuestionnaire),
                                _helper.ActionLink <ProfileController>(
                                    c => c.ExamQuestionnaire(null), "Анкета для сдачи экзаменов").ToString())
                 )
             );
     }
     return(root);
 }