private void LnkDocumentation_RequestNavigate(object sender, RequestNavigateEventArgs e) { try { string codeBase = Assembly.GetExecutingAssembly().CodeBase; UriBuilder codeBaseUri = new UriBuilder(codeBase); string codeBasePath = Uri.UnescapeDataString(codeBaseUri.Path); string documentationFilePath = Path.Combine(Path.GetDirectoryName(codeBasePath), "SessionTimeDocumentation.txt"); if (File.Exists(documentationFilePath)) { Process.Start(new ProcessStartInfo(documentationFilePath)); e.Handled = true; } else { MessageBox.Show("Cannot find SessionTimeDocumentation.txt in application folder."); } } catch (Exception ex) { SessionTimeViewerUtility.ShowException(ex); Utility.Log(ex.ToString()); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { try { string pathSessionTimeViewer = System.Reflection.Assembly.GetExecutingAssembly().Location; lblVersionSessionTimeViewer.Content = "SessionTimeViewer " + FileVersionInfo.GetVersionInfo(pathSessionTimeViewer).ProductVersion; string folderPathSessionTime = Path.GetDirectoryName(pathSessionTimeViewer); string pathSessionTimeMonitor = Path.Combine(folderPathSessionTime, "SessionTimeMonitor.exe"); if (File.Exists(pathSessionTimeMonitor)) { lblVersionSessionTimeMonitor.Content = "SessionTimeMonitor " + FileVersionInfo.GetVersionInfo(pathSessionTimeMonitor).ProductVersion; } string pathSessionTimeCommon = Path.Combine(folderPathSessionTime, "SessionTimeCommon.dll"); if (File.Exists(pathSessionTimeCommon)) { lblVersionSessionTimeCommon.Content = "SessionTimeCommon " + FileVersionInfo.GetVersionInfo(pathSessionTimeCommon).ProductVersion; } } catch (Exception ex) { SessionTimeViewerUtility.ShowException(ex); Utility.Log(ex.ToString()); } }
private void BtnClose_Click(object sender, RoutedEventArgs e) { try { DialogResult = true; } catch (Exception ex) { SessionTimeViewerUtility.ShowException(ex); Utility.Log(ex.ToString()); } }
private void BtnRefresh_Click(object sender, RoutedEventArgs e) { try { LoadData(); } catch (Exception ex) { SessionTimeViewerUtility.ShowException(ex); Utility.Log(ex.ToString()); } }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { try { LoadData(); } catch (Exception ex) { SessionTimeViewerUtility.ShowException(ex); Utility.Log(ex.ToString()); } }
private void LnkRepository_RequestNavigate(object sender, RequestNavigateEventArgs e) { try { Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); e.Handled = true; } catch (Exception ex) { SessionTimeViewerUtility.ShowException(ex); Utility.Log(ex.ToString()); } }
private void BtnInfo_Click(object sender, RoutedEventArgs e) { try { var aboutWindow = new AboutWindow(); aboutWindow.ShowDialog(); } catch (Exception ex) { SessionTimeViewerUtility.ShowException(ex); Utility.Log(ex.ToString()); } }
public MainWindow() { try { InitializeComponent(); this.Loaded += MainWindow_Loaded; } catch (Exception ex) { SessionTimeViewerUtility.ShowException(ex); Utility.Log(ex.ToString()); } }