Vollständige Implementierung des EngineeringSync-Middleware-Tools: - Windows Service (Kestrel :5050) mit FileSystemWatcher + SignalR - WPF Tray-App mit PendingChanges- und Projektverwaltungs-Fenster - Setup-Wizard (8-Schritte-Installer) - SQLite/EF Core Datenschicht (WAL-Modus) - SHA-256-basiertes Debouncing (2s Fenster) - Backup-System mit konfigurierbarer Aufbewahrung Bugfixes & Verbesserungen: - BUG-1: AppDbContext OnConfiguring invertierte Bedingung behoben - BUG-2: Event-Handler-Leak in TrayApp (Fenster-Singleton-Pattern) - BUG-3: ProjectConfigChanged SignalR-Signal in allen CRUD-Endpoints - BUG-5: Rename-Sync löscht alte Datei im Simulations-Ordner - BUG-6: Doppeltes Dispose von SignalR verhindert - BUG-7: Registry-Deinstallation nur EngineeringSync-Eintrag entfernt - S1: Path-Traversal-Schutz via SafeCombine() im SyncManager - E1: FSW Buffer 64KB + automatischer Re-Scan bei Overflow - E2: Retry-Logik (3x) für gesperrte Dateien mit exponentiellem Backoff - E4: Channel.Writer.TryComplete() beim Shutdown - C2: HubMethodNames-Konstanten statt Magic Strings - E3: Pagination in Changes-API (page/pageSize Query-Parameter) - A1: Fire-and-Forget mit try/catch + Logging Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
80 lines
2.9 KiB
C#
80 lines
2.9 KiB
C#
using System.IO;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using EngineeringSync.Setup.ViewModels;
|
|
using Microsoft.Win32;
|
|
|
|
namespace EngineeringSync.Setup.Views.Pages;
|
|
|
|
public partial class FirstProjectPage : WizardPageBase
|
|
{
|
|
public FirstProjectPage(WizardViewModel wizard) : base(wizard)
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void BrowseEngineering_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
var dlg = new OpenFolderDialog
|
|
{
|
|
Title = "Engineering-Quellpfad wählen",
|
|
InitialDirectory = Wizard.State.EngineeringPath
|
|
};
|
|
if (dlg.ShowDialog() == true)
|
|
Wizard.State.EngineeringPath = dlg.FolderName;
|
|
}
|
|
|
|
private void BrowseSimulation_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
var dlg = new OpenFolderDialog
|
|
{
|
|
Title = "Simulations-Zielpfad wählen",
|
|
InitialDirectory = Wizard.State.SimulationPath
|
|
};
|
|
if (dlg.ShowDialog() == true)
|
|
Wizard.State.SimulationPath = dlg.FolderName;
|
|
}
|
|
|
|
private void AddExt_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
var ext = (sender as Button)?.Tag?.ToString();
|
|
if (string.IsNullOrEmpty(ext)) return;
|
|
|
|
var current = Wizard.State.FileExtensions?.Trim() ?? string.Empty;
|
|
var parts = current.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
|
if (!parts.Contains(ext, StringComparer.OrdinalIgnoreCase))
|
|
Wizard.State.FileExtensions = current.Length > 0 ? current + "," + ext : ext;
|
|
}
|
|
|
|
public override bool Validate()
|
|
{
|
|
if (string.IsNullOrWhiteSpace(Wizard.State.ProjectName))
|
|
{
|
|
MessageBox.Show("Bitte geben Sie einen Projektnamen an.",
|
|
"Validierung", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
return false;
|
|
}
|
|
if (string.IsNullOrWhiteSpace(Wizard.State.EngineeringPath) ||
|
|
!Directory.Exists(Wizard.State.EngineeringPath))
|
|
{
|
|
MessageBox.Show("Der Engineering-Pfad existiert nicht oder ist nicht angegeben.",
|
|
"Validierung", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
return false;
|
|
}
|
|
if (string.IsNullOrWhiteSpace(Wizard.State.SimulationPath) ||
|
|
!Directory.Exists(Wizard.State.SimulationPath))
|
|
{
|
|
MessageBox.Show("Der Simulations-Pfad existiert nicht oder ist nicht angegeben.",
|
|
"Validierung", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
return false;
|
|
}
|
|
if (!Wizard.State.WatchAllFiles && string.IsNullOrWhiteSpace(Wizard.State.FileExtensions))
|
|
{
|
|
MessageBox.Show("Bitte geben Sie mindestens eine Dateiendung an oder wählen Sie 'Alle Dateitypen überwachen'.",
|
|
"Validierung", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
}
|