/// <summary>Clears all TextBoxes.</summary> private void Clear() { TxtID.Clear(); CmbCourse.SelectedIndex = -1; CmbTeacher.SelectedIndex = -1; TxtDaily.Clear(); TxtHomework.Clear(); TxtProject.Clear(); TxtQuiz.Clear(); TxtReport.Clear(); TxtTest.Clear(); TxtStartTime.Text = "9:00 AM"; TxtEndTime.Text = "9:50 AM"; TxtID.Focus(); TxtError.Visibility = Visibility.Collapsed; }
/// <summary> /// 发送报告文本到界面 /// </summary> /// <param name="e"></param> private void AppendReport(EventArgs e) { Dispatcher.Invoke(() => { var message = AdminReportService.Instance.PopupReport(); if (message == null) return; TxtReport.AppendText($"[{DateTime.Now:yyyy-MM-dd HH:mm:ss fff}]"); TxtReport.AppendText(" => "); TxtReport.AppendText(message.Message); TxtReport.AppendText("\r\n"); TxtReport.ScrollToEnd(); if (TxtReport.Text.Length > 3000) { TxtReport.Clear(); } }); }
/// <summary> /// 清空消息记录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ClearTextReport(object sender, RoutedEventArgs e) { TxtReport.Clear(); }