Esempio n. 1
0
 /*return Grid.Row of giben object*/
 public int[] getRowForTable(TimetableObject item)
 {
     int[] row = { -1, -1 };
     timeToRowDictionaryBeginTime.TryGetValue(item.BeginTime, out row[0]);
     TimeToRowDictionaryEndTime.TryGetValue(item.EndTime, out row[1]);
     return(row);
 }
Esempio n. 2
0
        /*setup a textBlock with all required information for roomtimetable*/
        public TextBlock setupRoomTimetableTextBlock(TimetableObject item)
        {
            TextBlock tb = new TextBlock();

            tb.TextWrapping = TextWrapping.Wrap;
            tb.FontSize     = 12;
            tb.MaxLines     = 10;

            Thickness thickness = new Thickness();

            thickness.Right = thickness.Left = thickness.Top = thickness.Bottom = 1;
            tb.Padding      = thickness;

            Span lessonSpan = new Span();
            Run  lesson     = new Run();

            lesson.Text           = item.LessonTag;
            lessonSpan.FontWeight = Windows.UI.Text.FontWeights.SemiBold;
            lessonSpan.Inlines.Add(lesson);

            Span profSpan = new Span();
            Run  prof     = new Run();

            prof.Text          = item.Professor;
            profSpan.FontStyle = Windows.UI.Text.FontStyle.Normal;
            profSpan.Inlines.Add(prof);

            tb.Inlines.Add(lessonSpan);
            tb.Inlines.Add(new LineBreak());
            tb.Inlines.Add(profSpan);

            Grid.SetColumn(tb, item.Day);
            return(tb);
        }
Esempio n. 3
0
        /*setup a textBlock with all required information for timetable*/
        public TextBlock setupTimetableTextBlock(TimetableObject item)
        {
            TextBlock tb = new TextBlock();

            tb.TextWrapping = TextWrapping.Wrap;
            tb.FontSize     = 12;
            tb.MaxLines     = 10;
            Thickness thickness = new Thickness();

            thickness.Right = thickness.Left = thickness.Top = thickness.Bottom = 1;
            tb.Padding      = thickness;

            Span lessonSpan = new Span();
            Run  lesson     = new Run();

            lesson.Text           = item.LessonTag + " (" + item.Type + ")";
            lessonSpan.FontWeight = Windows.UI.Text.FontWeights.SemiBold;
            lessonSpan.Inlines.Add(lesson);

            Span profSpan = new Span();
            Run  prof     = new Run();

            prof.Text          = item.Professor.Equals("")? "verschiedene Dozenten" : item.Professor;
            profSpan.FontStyle = Windows.UI.Text.FontStyle.Italic;
            profSpan.Inlines.Add(prof);

            Span roomSpan = new Span();
            Run  roomRun  = new Run();

            foreach (String room in item.Rooms)
            {
                roomRun.Text += room + ' ';
            }
            roomSpan.FontStyle = Windows.UI.Text.FontStyle.Normal;
            roomSpan.Inlines.Add(roomRun);

            tb.Inlines.Add(lessonSpan);
            tb.Inlines.Add(new LineBreak());
            tb.Inlines.Add(profSpan);
            tb.Inlines.Add(new LineBreak());
            tb.Inlines.Add(roomSpan);

            Grid.SetColumn(tb, item.Day);

            return(tb);
        }