private void applicationLogToolStripMenuItem_Click(object sender, EventArgs e) { string fileName = Path.Combine("Logs", "PrintQueueInstaller-{0}.log".FormatWith(Process.GetCurrentProcess().Id)); if (File.Exists(fileName)) { using (var fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { var textReader = new StreamReader(fileStream); using (TextDisplayDialog textBox = new TextDisplayDialog(textReader.ReadToEnd())) { textBox.ShowDialog(); } } } else { MessageBox.Show ( "Log file not found", "View Application Log File", MessageBoxButtons.OK, MessageBoxIcon.Error ); } }
private void dispatcherLog_ToolStripButton_Click(object sender, EventArgs e) { using (TextDisplayDialog dialog = new TextDisplayDialog()) { dialog.Data = SessionClient.Instance.GetLogData(SessionId); dialog.ShowDialog(this); } }
private void viewInf_Button_Click(object sender, EventArgs e) { if (inboxDriver_DataGridView.SelectedRows.Count > 0 && inboxDriver_DataGridView.SelectedRows[0].Index > 0) { _driver = inboxDriver_DataGridView.SelectedRows[0].DataBoundItem as PrintDeviceDriver; using (TextDisplayDialog textBox = new TextDisplayDialog(File.ReadAllText(_driver.InfPath), _driver.InfPath)) { textBox.ShowDialog(); } } }
private void openLogFileButton_Click(object sender, EventArgs e) { var pid = Process.GetCurrentProcess().Id; var filePath = Directory.GetFiles(_logPath, "*-{0}.log".FormatWith(pid)).FirstOrDefault(); if (!string.IsNullOrEmpty(filePath)) { using (TextDisplayDialog dialog = new TextDisplayDialog(LogFileReader.Read(filePath), filePath)) { dialog.ShowDialog(this); } } else { MessageBox.Show("Log file not found for this worker"); } }