This repository has been archived on 2025-07-21. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
EnvyUpdate/EnvyUpdate/InfoWindow.xaml.cs

57 lines
2 KiB
C#
Raw Normal View History

using System;
using System.Windows;
using System.Windows.Input;
using System.IO;
namespace EnvyUpdate
{
/// <summary>
/// Interaction logic for InfoWindow.xaml
/// </summary>
public partial class InfoWindow : Window
{
public InfoWindow()
{
InitializeComponent();
2021-05-08 11:51:49 +02:00
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion;
2021-05-08 11:51:49 +02:00
labelVer.Content += " " + version;
2023-01-11 20:05:58 +01:00
if (GlobalVars.monitoringInstall)
labelVer.FontStyle = FontStyles.Italic;
2023-07-09 18:19:33 +02:00
2023-07-09 18:24:44 +02:00
if (File.Exists(Path.Combine(GlobalVars.exedirectory, "envyupdate.log")))
2023-07-09 18:19:33 +02:00
chkLog.IsChecked = true;
}
private void ButtonWeb_Click(object sender, RoutedEventArgs e)
{
2023-04-03 20:55:22 +02:00
Debug.LogToFile("INFO Launching website.");
System.Diagnostics.Process.Start("https://github.com/fyr77/EnvyUpdate/");
}
2023-07-09 18:19:33 +02:00
private void chkLog_Checked(object sender, RoutedEventArgs e)
{
2023-07-09 18:35:46 +02:00
if (!Debug.isVerbose)
{
Debug.isVerbose = true;
Debug.LogToFile("------");
Debug.LogToFile("INFO Enabled logging to file. Restart Application to see full startup log.");
}
2023-07-09 18:19:33 +02:00
}
private void chkLog_Unchecked(object sender, RoutedEventArgs e)
{
2023-07-09 18:35:46 +02:00
if (Debug.isVerbose)
{
Debug.LogToFile("INFO Disabled logging to file.");
if (File.Exists(Path.Combine(GlobalVars.exedirectory, "envyupdate.log")))
File.Move(Path.Combine(GlobalVars.exedirectory, "envyupdate.log"), Path.Combine(GlobalVars.exedirectory, "envyupdate." + DateTime.Now.ToString("yyyyMMdd-HHmmss") + ".log"));
Debug.isVerbose = false;
}
2023-07-09 18:19:33 +02:00
}
}
}