private void eventDescriptionMenuItem_Click(object sender, EventArgs e) { InformationDialog dlg = new InformationDialog(); Cursor oldCursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; String info = DiagnosticsUtils.getDiagnosticsEventProvider(); dlg.Text = "Provider Information"; dlg.TextBox.WordWrap = true; dlg.TextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; if (info != null) { dlg.TextBox.Text = info; } else { dlg.TextBox.Text = "Unable to get event description information"; } // Unselect the text just added dlg.TextBox.Select(0, 0); Cursor.Current = oldCursor; dlg.Show(); }
/// <summary> /// Common method used to display event summaries. /// </summary> /// <param name="startId">Starting event ID.</param> /// <param name="endId">Ending eventId.</param> private void showSummaryDialog(String title, int startId, int endId) { InformationDialog dlg = new InformationDialog(); Cursor oldCursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; String info = title + LF; info += "Data as of: " + DateTime.Now + LF + LF; info += DiagnosticsUtils.getDiagnosticsLogForEvents(startId, endId); dlg.Text = title; dlg.TextBox.WordWrap = true; dlg.TextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; // Adjust the size for the screen resolution dlg.ClientSize = Utils.getDpiAdjustedSize(this, new Size(500, 500)); if (info != null) { dlg.TextBox.Text = info; } else { dlg.TextBox.Text = "Unable to get " + title; } // Unselect the text just added dlg.TextBox.Select(0, 0); Cursor.Current = oldCursor; dlg.Show(); }