Exemplo n.º 1
0
 public DefaultIIndexableCollection(string name, string abbr, IdSigner <T> signer, IEnumerable <T> items)
 {
     this.Name = name;
     this.Abbr = abbr;
     this.IIndexableItemsCatalog = new Dictionary <uint, T>();
     foreach (T item in items)
     {
         // Generate course universal id as the key (not the course name any more)
         this.IIndexableItemsCatalog.Add(signer.SignId(item), item);
     }
 }
Exemplo n.º 2
0
        public Program()
        {
            DefaultIIndexableCollection<Course> UOfTCourses;
            DefaultIIndexableCollection<SchoolProgram> UOfTPrograms;
            IdSigner<Course> courseSigner = new IdSigner<Course>();
            IdSigner<SchoolProgram> progSigner = new IdSigner<SchoolProgram>();

            IItemFetcher<UTCourse> artsciCourseFetcher = new UTArtsciCourseFetcher();
            IItemFetcher<UTCourse> engCourseFetcher = new UTEngCourseFetcher();

            UOfTCourses = new DefaultIIndexableCollection<Course>("University of Toronto", "uoft_courses", courseSigner, artsciCourseFetcher.FetchItems().Concat<UTCourse>(engCourseFetcher.FetchItems()));
            UOfTCourses.Save();

            IItemFetcher<SchoolProgram> artsciProgramFetcher = new UTArtsciProgramFetcher();
            UOfTPrograms = new DefaultIIndexableCollection<SchoolProgram>("University of Toronto", "uoft_progs", progSigner, artsciProgramFetcher.FetchItems());
            UOfTPrograms.Save();
        }
Exemplo n.º 3
0
        public Program()
        {
            DefaultIIndexableCollection <Course>        UOfTCourses;
            DefaultIIndexableCollection <SchoolProgram> UOfTPrograms;
            IdSigner <Course>        courseSigner = new IdSigner <Course>();
            IdSigner <SchoolProgram> progSigner   = new IdSigner <SchoolProgram>();

            UOfTCourses = new DefaultIIndexableCollection <Course>("University of Toronto", "uoft_courses", courseSigner,
                                                                   new UTEngCourseFetcher().FetchItems()
                                                                   //new UTArtsciCourseFetcher().FetchItems()
                                                                   //new UTSCCourseFetcher().FetchItems()
                                                                   .Concat <UTCourse>(new UTArtsciCourseFetcher().FetchItems())
                                                                   .Concat <UTCourse>(new UTSCCourseFetcher().FetchItems())
                                                                   .Concat <UTCourse>(new UTMCourseFetcher().FetchItems())
                                                                   );
            UOfTCourses.SaveBin();

            UOfTPrograms = new DefaultIIndexableCollection <SchoolProgram>("University of Toronto", "uoft_progs", progSigner,
                                                                           new UTArtsciProgramFetcher().FetchItems()
                                                                           .Concat <SchoolProgram>(new UTEngProgramFetcher(WebUrlConstants.EngPrograms).FetchItems())
                                                                           .Concat <SchoolProgram>(new UTSCProgramFetcher().FetchItems())
                                                                           .Concat <SchoolProgram>(new UTMProgramFetcher().FetchItems()));
            UOfTPrograms.SaveBin();
        }
Exemplo n.º 4
0
        public Program()
        {
            DefaultIIndexableCollection<Course> UOfTCourses;
            DefaultIIndexableCollection<SchoolProgram> UOfTPrograms;
            IdSigner<Course> courseSigner = new IdSigner<Course>();
            IdSigner<SchoolProgram> progSigner = new IdSigner<SchoolProgram>();

            IItemFetcher<UTCourse> artsciCourseFetcher = new UTArtsciCourseFetcher();
            IItemFetcher<UTCourse> artsciSeminarFetcher = new UTArtsciSeminarFetcher();
            IItemFetcher<UTCourse> engCourseFetcher = new UTEngCourseFetcher();
            IItemFetcher<UTCourse> utscCourseFetcher = new UTSCCourseFetcher();
            IItemFetcher<UTCourse> utmCourseFetcher = new UTMCourseFetcher();

            UOfTCourses = new DefaultIIndexableCollection<Course>("University of Toronto", "uoft_courses", courseSigner,
                engCourseFetcher.FetchItems()
                //artsciCourseFetcher.FetchItems()
                //utscCourseFetcher.FetchItems()
                .Concat<UTCourse>(artsciCourseFetcher.FetchItems())
                //.Concat<UTCourse>(artsciSeminarFetcher.FetchItems())
                .Concat<UTCourse>(utscCourseFetcher.FetchItems())
                .Concat<UTCourse>(utmCourseFetcher.FetchItems())
                );
            UOfTCourses.SaveBin();

            IItemFetcher<SchoolProgram> artsciProgramFetcher = new UTArtsciProgramFetcher();
            IItemFetcher<SchoolProgram> engProgramFetcher = new UTEngProgramFetcher(WebUrlConstants.EngPrograms);
            IItemFetcher<SchoolProgram> utscProgramFetcher = new UTSCProgramFetcher();
            IItemFetcher<SchoolProgram> utmProgramFetcher = new UTMProgramFetcher();

            UOfTPrograms = new DefaultIIndexableCollection<SchoolProgram>("University of Toronto", "uoft_progs", progSigner,
                artsciProgramFetcher.FetchItems()
                .Concat<SchoolProgram>(engProgramFetcher.FetchItems())
                .Concat<SchoolProgram>(utscProgramFetcher.FetchItems())
                .Concat<SchoolProgram>(utmProgramFetcher.FetchItems()));
            UOfTPrograms.SaveBin();
        }