/// <summary> /// Shows the information about a specific lessons in a new panel. /// </summary> /// <param name="sender">The object sender</param> /// <param name="lesson">The lesson to get information for</param> private void ShowInformationAboutLesson(object sender, LessonClickEventArgs lesson) { _showInformation = new Panel { Width = panelContainingUpcomingLessons.Width, Height = panelContainingUpcomingLessons.Height, Location = panelContainingUpcomingLessons.Location, BackColor = Color.White }; Label titleForLesson = new Label { AutoSize = false, Height = 40, Font = new Font("Calibri Light", 10F, FontStyle.Regular), ForeColor = ColorScheme.MainFontColor, TextAlign = ContentAlignment.MiddleLeft, Dock = DockStyle.Top, Text = lesson.Lesson.LessonTemplate.Title }; TextBox descriptionForLesson = new TextBox() { AutoSize = false, Width = _showInformation.Width - 40, Height = 100, Multiline = true, ReadOnly = true, ScrollBars = ScrollBars.Vertical, BackColor = Color.White, BorderStyle = BorderStyle.None, Font = new Font("Calibri Light", 10F, FontStyle.Regular), ForeColor = ColorScheme.MainFontColor, Dock = DockStyle.Top, Text = lesson.Lesson.LessonTemplate.Description }; Label dateForLesson = new Label { AutoSize = false, Height = 40, Font = new Font("Calibri Light", 10F, FontStyle.Regular), ForeColor = ColorScheme.MainFontColor, TextAlign = ContentAlignment.MiddleLeft, Dock = DockStyle.Top, Text = $@"Date: {lesson.Lesson.StartDate:f} - {lesson.Lesson.EndDate:t}" }; Label readingForLesson = new Label { AutoSize = false, Height = 40, Font = new Font("Calibri Light", 10F, FontStyle.Regular), ForeColor = ColorScheme.MainFontColor, TextAlign = ContentAlignment.MiddleLeft, Dock = DockStyle.Top, Text = $@"Reading: {lesson.Lesson.LessonTemplate.Reading}" }; Label instructorForLesson = new Label { AutoSize = false, Height = 40, Font = new Font("Calibri Light", 10F, FontStyle.Regular), ForeColor = ColorScheme.MainFontColor, TextAlign = ContentAlignment.MiddleLeft, Dock = DockStyle.Top, Text = $@"Instructor for lesson: {lesson.Lesson.InstructorFullname}" }; _showInformation.Controls.Add(instructorForLesson); _showInformation.Controls.Add(readingForLesson); _showInformation.Controls.Add(dateForLesson); _showInformation.Controls.Add(descriptionForLesson); _showInformation.Controls.Add(titleForLesson); panel1.Controls.Add(_showInformation); dateLabel.Hide(); timelLabel.Hide(); lessonLabel.Hide(); panelContainingUpcomingLessons.Hide(); backButtonInUpcomingLesson.Show(); }
public void panelUpcomingLesson_click(LessonClickEventArgs e) { ClickOnUpcomingLessonTriggered?.Invoke(this, e); }