2020-08-03 19:54:08 +02:00
using System ;
using System.Windows ;
2020-07-14 15:31:32 +02:00
using System.Windows.Input ;
2020-08-03 19:54:08 +02:00
using System.IO ;
2020-07-14 15:31:32 +02:00
namespace EnvyUpdate
{
/// <summary>
/// Interaction logic for InfoWindow.xaml
/// </summary>
public partial class InfoWindow : Window
{
public InfoWindow ( )
{
InitializeComponent ( ) ;
2020-08-03 19:54:08 +02:00
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 ;
2020-08-03 19:54:08 +02:00
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 ;
2020-07-14 15:31:32 +02:00
}
2020-08-03 19:54:08 +02:00
private void ButtonWeb_Click ( object sender , RoutedEventArgs e )
2020-07-14 15:31:32 +02:00
{
2023-04-03 20:55:22 +02:00
Debug . LogToFile ( "INFO Launching website." ) ;
2020-07-14 15:31:32 +02:00
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
}
2020-07-14 15:31:32 +02:00
}
}