Elwig: Fix most compiler warnings
Test / Run tests (push) Successful in 2m29s

This commit is contained in:
lorenz.stechauner committed 2026-11-24 19:37:13 +01:00
1 parent 9e110a467a
commit 2cc58f8df6
24 files changed
+112 -125

No files matched your search

+6 -6
View File
@@ -51,14 +51,14 @@ namespace Elwig.Windows {
}
private void Window_Closing(object sender, CancelEventArgs evt) {
if (App.NumWindows > 1 && !App.ForceShutdown) {
if (App.Current.Windows.Count > 1 && !App.ForceShutdown) {
foreach (var w in Application.Current.Windows.Cast<Window>().Where(w => w is AdministrationWindow adm && (adm.IsEditing || adm.IsCreating))) {
try {
w.Close();
} catch { }
}
Thread.Sleep(100);
if (App.NumWindows > 1) {
if (App.Current.Windows.Count > 1) {
var areAdminWindowsOpen = Application.Current.Windows.Cast<Window>().Any(w => w is AdministrationWindow adm && (adm.IsEditing || adm.IsCreating));
if (areAdminWindowsOpen && !InteractionService.AskConfirmation("Elwig beenden", "Es sind noch weitere Fenster geöffnet.\nSollen alle Fenster geschlossen werden?")) {
evt.Cancel = true;
@@ -66,7 +66,7 @@ namespace Elwig.Windows {
}
}
}
App.CurrentApp.ShutdownGracefully();
App.Current.ShutdownGracefully();
}
private void Menu_Help_About_Click(object sender, RoutedEventArgs evt) {
@@ -273,7 +273,7 @@ namespace Elwig.Windows {
"Wenn Sie unsicher sind sprechen Sie sich mit dem Benutzer des Hauptgerätes ab!"))
return;
await App.MainDispatcher.BeginInvoke(async () => {
await App.Current.Dispatcher.BeginInvoke(async () => {
await App.ReplaceDatabase(filename);
});
} catch (HttpRequestException exc) {
@@ -373,7 +373,7 @@ namespace Elwig.Windows {
ch = await SyncService.ChangesAvailable(ctx, App.Config.SyncUrl, App.Config.SyncUsername, App.Config.SyncPassword, default);
}
}
await App.MainDispatcher.BeginInvoke(() => {
await App.Current.Dispatcher.BeginInvoke(() => {
if (ch) {
SyncButton_1.Text = "\uEA6A";
SyncButton_2.Text = "\uEA81";
@@ -419,7 +419,7 @@ namespace Elwig.Windows {
var weightTotal = await ctx.DeliveryParts.Where(p => p.Year == year).SumAsync(p => p.Weight);
var ctrdWeight = await ctx.DeliveryPartBuckets.Where(b => b.Year == year && b.Discr != "_").SumAsync(b => b.Value);
var area = await areaCmts.SumAsync(c => c.Area);
await App.MainDispatcher.BeginInvoke(() => {
await App.Current.Dispatcher.BeginInvoke(() => {
if (year != SeasonInput.Value) return;
SeasonStatMembersTotal.Text = $"{membersTotal:N0}";
SeasonStatMembersCtrd.Text = $"{membersCtrd:N0}";