Exemplo n.º 1
0
        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());
            }
        }
Exemplo n.º 2
0
        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());
            }
        }
Exemplo n.º 3
0
 private void BtnClose_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         DialogResult = true;
     }
     catch (Exception ex)
     {
         SessionTimeViewerUtility.ShowException(ex);
         Utility.Log(ex.ToString());
     }
 }
Exemplo n.º 4
0
 private void BtnRefresh_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         LoadData();
     }
     catch (Exception ex)
     {
         SessionTimeViewerUtility.ShowException(ex);
         Utility.Log(ex.ToString());
     }
 }
Exemplo n.º 5
0
 void MainWindow_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         LoadData();
     }
     catch (Exception ex)
     {
         SessionTimeViewerUtility.ShowException(ex);
         Utility.Log(ex.ToString());
     }
 }
Exemplo n.º 6
0
 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());
     }
 }
Exemplo n.º 7
0
 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());
     }
 }
Exemplo n.º 8
0
 public MainWindow()
 {
     try
     {
         InitializeComponent();
         this.Loaded += MainWindow_Loaded;
     }
     catch (Exception ex)
     {
         SessionTimeViewerUtility.ShowException(ex);
         Utility.Log(ex.ToString());
     }
 }