public Content(IElementContainer container, ElementCollection elementCollection) { _parent = container; _elements = elementCollection; UpdateContentHeight(); }
public Course Get(uint id) { if (!(bool)HttpContext.Current.Application["Updating"]) { IIndexableCollection <Course> courses = (IIndexableCollection <Course>)HttpContext.Current.Application["Courses"]; Course result; if (courses.TryGetItem(id, out result)) { if (result is UTCourse) { UTCourse utResult = result as UTCourse; utResult.Prerequisites = ReplaceCourseCode(utResult.Prerequisites); utResult.Corequisites = ReplaceCourseCode(utResult.Corequisites); utResult.Exclusions = ReplaceCourseCode(utResult.Exclusions); return(utResult); } } } return(null); }
public SearchEngine(InvertedWordIndex index, IIndexableCollection <T> collection) { this.Index = index; this.Collection = collection; this.Corrector = new SuffixCorrector(this.Index.SortedKeys); }
public Content(IElementContainer container) { _parent = container; _elements = new ElementCollection(this); }
public bool TryAddCourse(uint courseId, string courseString, string sectionCode, iCalendar calendar) { IIndexableCollection <Course> courses = (IIndexableCollection <Course>)HttpContext.Current.Application["Courses"]; Course course; if (courses.TryGetItem(courseId, out course)) { if (!courseString.StartsWith(course.Abbr)) { return(false); } foreach (CourseSection section in course.Sections) { if (section.Name == sectionCode) { UTCourseSection utSection = section as UTCourseSection; UTCourse utCourse = course as UTCourse; if (utSection != null && utCourse != null) { int order = 0; foreach (CourseSectionTimeSpan timeSpan in utSection.ParsedTime.MeetTimes) { if (utCourse.SemesterDetail == "Fall" || utCourse.SemesterDetail == "Year") { Event courseEvent = calendar.Create <Event>(); if (utCourse.Faculty == "Engineering") { courseEvent.Start = new iCalDateTime(this.ConvertDateTime(new DateTime(2020, 9, 1), timeSpan.Day, timeSpan.Start), "America/Toronto"); courseEvent.End = new iCalDateTime(this.ConvertDateTime(new DateTime(2020, 9, 1), timeSpan.Day, timeSpan.End), "America/Toronto"); courseEvent.RecurrenceRules.Add(new RecurrencePattern(FrequencyType.Weekly) { //Count = 13 Until = new DateTime(2020, 12, 15) }); } else { courseEvent.Start = new iCalDateTime(this.ConvertDateTime(new DateTime(2018, 9, 6), timeSpan.Day, timeSpan.Start), "America/Toronto"); courseEvent.End = new iCalDateTime(this.ConvertDateTime(new DateTime(2018, 9, 6), timeSpan.Day, timeSpan.End), "America/Toronto"); courseEvent.RecurrenceRules.Add(new RecurrencePattern(FrequencyType.Weekly) { //Count = 13 Until = new DateTime(2020, 12, 15) }); } courseEvent.Summary = utCourse.Abbr + ": " + utCourse.Name + " " + utSection.Name; try { courseEvent.Location = utSection.Location.Split(' ')[order]; } catch { } } if (utCourse.SemesterDetail == "Winter" || utCourse.SemesterDetail == "Year") { Event courseEvent = calendar.Create <Event>(); if (utCourse.Faculty == "Engineering") { courseEvent.Start = new iCalDateTime(this.ConvertDateTime(new DateTime(2021, 1, 3), timeSpan.Day, timeSpan.Start), "America/Toronto"); courseEvent.End = new iCalDateTime(this.ConvertDateTime(new DateTime(2021, 1, 3), timeSpan.Day, timeSpan.End), "America/Toronto"); courseEvent.RecurrenceRules.Add(new RecurrencePattern(FrequencyType.Weekly) { Until = new DateTime(2021, 4, 10) //Count = 13 }); } else { courseEvent.Start = new iCalDateTime(this.ConvertDateTime(new DateTime(2021, 1, 3), timeSpan.Day, timeSpan.Start), "America/Toronto"); courseEvent.End = new iCalDateTime(this.ConvertDateTime(new DateTime(2021, 1, 3), timeSpan.Day, timeSpan.End), "America/Toronto"); courseEvent.RecurrenceRules.Add(new RecurrencePattern(FrequencyType.Weekly) { Until = new DateTime(2021, 4, 10) //Count = 13 }); } courseEvent.Summary = utCourse.Abbr + ": " + utCourse.Name + " " + utSection.Name; try { courseEvent.Location = utSection.Location.Split(' ')[order]; } catch { } } order++; } } return(true); } } } return(false); }
public CourseSearchPresenter(InvertedWordIndex index, IIndexableCollection <Course> collection) : base(index, collection) { }
public DefaultIIndexablePresenter(InvertedWordIndex index, IIndexableCollection <T> collection) { this.Index = index; this.ItemCollection = collection; this.Corrector = new SuffixCorrector(this.Index.SortedKeys); }
public ProgramSearchPresenter(InvertedWordIndex index, IIndexableCollection <SchoolProgram> collection) : base(index, collection) { }