private void RelhaxWindow_Loaded(object sender, RoutedEventArgs e) { if (Credential == null) { throw new NullReferenceException(nameof(Credential) + " is null"); } databaseClient = new WebClient() { Credentials = Credential }; databaseClient.DownloadProgressChanged += DatabaseClient_DownloadProgressChanged; client.DownloadProgressChanged += Client_DownloadProgressChanged; Logging.Editor("Checking if registry key is set for IE11 for this application"); using (System.Windows.Forms.WebBrowser bro = new System.Windows.Forms.WebBrowser()) SetRegistryKey(System.Diagnostics.Process.GetCurrentProcess().ProcessName, bro.Version.Major); Logging.Editor("Attaching datasources", LogLevel.Debug); PackageNamesListbox.ItemsSource = Packages; //set autoupdate output directory Logging.Editor("Setting update output directory", LogLevel.Debug); UpdateOutputDirectory = Path.Combine(WorkingDirectory, "Output"); if (!Directory.Exists(UpdateOutputDirectory)) { Directory.CreateDirectory(UpdateOutputDirectory); } //attach logfile reporting LogfileTextbox.Clear(); Logging.OnLoggingUIThreadReport += Logging_OnLoggingUIThreadReport; }
private void LogfileTextbox_TextChanged(object sender, TextChangedEventArgs e) { LogfileTextbox.ScrollToEnd(); }
private void ClearLogButton_Click(object sender, RoutedEventArgs e) { LogfileTextbox.Clear(); }
private void Logging_OnLoggingUIThreadReport(string message) { LogfileTextbox.AppendText(message + Environment.NewLine); }