Helper class for dividing lectures to groups for rendering and export to svg
示例#1
0
 public static List<List<TimetableField>> getGroups(List<TimetableField> fields)
 {
     List<List<TimetableField>> groups = new LecturesGroupDivider().divideToGroups(fields);
     return groups;
 }
示例#2
0
        private string RenderLectures(List<ExportLecture> lectures)
        {
            string res = "";
            if (lectures != null)
            {
                lectures.Sort((x, y) => x.Day == y.Day ?
                DateTime.Compare(x.StartTime, y.StartTime) :
                x.Day.CompareTo(y.Day));
                List < List < ExportLecture >> groups = new LecturesGroupDivider().divideToGroups(lectures);
                foreach (var group in groups)
                {
                    foreach (var lecture in group)
                    {
                        //Dont render fake lectures created in grouping process
                        if (lecture.Name != null)
                        {
                            res += RenderLecture(lecture, group.Count, group.IndexOf(lecture));
                        }

                    }
                }
            }

            return res;
        }