|
@@ -3,157 +3,66 @@ using Avalonia;
|
|
|
using Avalonia.Controls;
|
|
using Avalonia.Controls;
|
|
|
using Avalonia.Controls.ApplicationLifetimes;
|
|
using Avalonia.Controls.ApplicationLifetimes;
|
|
|
using Avalonia.Input;
|
|
using Avalonia.Input;
|
|
|
-using Avalonia.Media.Imaging;
|
|
|
|
|
using Avalonia.Threading;
|
|
using Avalonia.Threading;
|
|
|
-using ImageMagick;
|
|
|
|
|
using PicView.Avalonia.Keybindings;
|
|
using PicView.Avalonia.Keybindings;
|
|
|
using PicView.Avalonia.Navigation;
|
|
using PicView.Avalonia.Navigation;
|
|
|
|
|
+using PicView.Avalonia.UI;
|
|
|
using PicView.Avalonia.ViewModels;
|
|
using PicView.Avalonia.ViewModels;
|
|
|
using PicView.Core.ArchiveHandling;
|
|
using PicView.Core.ArchiveHandling;
|
|
|
using PicView.Core.Calculations;
|
|
using PicView.Core.Calculations;
|
|
|
using PicView.Core.Config;
|
|
using PicView.Core.Config;
|
|
|
using PicView.Core.FileHandling;
|
|
using PicView.Core.FileHandling;
|
|
|
-using PicView.Core.Navigation;
|
|
|
|
|
|
|
|
|
|
-namespace PicView.Avalonia.UI;
|
|
|
|
|
|
|
+namespace PicView.Avalonia.WindowBehavior;
|
|
|
|
|
|
|
|
-public static class WindowHelper
|
|
|
|
|
|
|
+public static class WindowFunctions
|
|
|
{
|
|
{
|
|
|
- #region Window Dragging and size changing
|
|
|
|
|
-
|
|
|
|
|
- public static void WindowDragAndDoubleClickBehavior(Window window, PointerPressedEventArgs e)
|
|
|
|
|
- {
|
|
|
|
|
- if (e.ClickCount == 2 && e.GetCurrentPoint(window).Properties.IsLeftButtonPressed)
|
|
|
|
|
- {
|
|
|
|
|
- _ = MaximizeRestore();
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- var currentScreen = ScreenHelper.ScreenSize;
|
|
|
|
|
- window.BeginMoveDrag(e);
|
|
|
|
|
- var screen = window.Screens.ScreenFromVisual(window);
|
|
|
|
|
- if (screen != null)
|
|
|
|
|
- {
|
|
|
|
|
- if (screen.WorkingArea.Width != currentScreen.WorkingAreaWidth ||
|
|
|
|
|
- screen.WorkingArea.Height != currentScreen.WorkingAreaHeight || screen.Scaling != currentScreen.Scaling)
|
|
|
|
|
- {
|
|
|
|
|
- ScreenHelper.UpdateScreenSize(window);
|
|
|
|
|
- SetSize(window.DataContext as MainViewModel);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static void WindowDragBehavior(Window window, PointerPressedEventArgs e)
|
|
|
|
|
|
|
+ public static async Task WindowClosingBehavior(Window window)
|
|
|
{
|
|
{
|
|
|
- var currentScreen = ScreenHelper.ScreenSize;
|
|
|
|
|
- window.BeginMoveDrag(e);
|
|
|
|
|
- var screen = window.Screens.ScreenFromVisual(window);
|
|
|
|
|
- if (screen != null)
|
|
|
|
|
|
|
+ if (!SettingsHelper.Settings.WindowProperties.Maximized ||
|
|
|
|
|
+ !SettingsHelper.Settings.WindowProperties.Fullscreen || SettingsHelper.Settings.WindowProperties.AutoFit)
|
|
|
{
|
|
{
|
|
|
- if (screen.WorkingArea.Width != currentScreen.WorkingAreaWidth ||
|
|
|
|
|
- screen.WorkingArea.Height != currentScreen.WorkingAreaHeight || screen.Scaling != currentScreen.Scaling)
|
|
|
|
|
- {
|
|
|
|
|
- ScreenHelper.UpdateScreenSize(window);
|
|
|
|
|
- SetSize(window.DataContext as MainViewModel);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ WindowResizing.SaveSize(window);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- public static void InitializeWindowSizeAndPosition(Window window)
|
|
|
|
|
- {
|
|
|
|
|
if (Dispatcher.UIThread.CheckAccess())
|
|
if (Dispatcher.UIThread.CheckAccess())
|
|
|
{
|
|
{
|
|
|
- window.Position = new PixelPoint((int)SettingsHelper.Settings.WindowProperties.Left, (int)SettingsHelper.Settings.WindowProperties.Top);
|
|
|
|
|
- window.Width = SettingsHelper.Settings.WindowProperties.Width;
|
|
|
|
|
- window.Height = SettingsHelper.Settings.WindowProperties.Height;
|
|
|
|
|
|
|
+ window.Hide();
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- Dispatcher.UIThread.InvokeAsync(() =>
|
|
|
|
|
- {
|
|
|
|
|
- window.Position = new PixelPoint((int)SettingsHelper.Settings.WindowProperties.Left, (int)SettingsHelper.Settings.WindowProperties.Top);
|
|
|
|
|
- window.Width = SettingsHelper.Settings.WindowProperties.Width;
|
|
|
|
|
- window.Height = SettingsHelper.Settings.WindowProperties.Height;
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static void HandleWindowResize(Window window, AvaloniaPropertyChangedEventArgs<Size> size)
|
|
|
|
|
- {
|
|
|
|
|
- if (!SettingsHelper.Settings.WindowProperties.AutoFit)
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (!size.OldValue.HasValue || !size.NewValue.HasValue)
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (size.OldValue.Value.Width == 0 || size.OldValue.Value.Height == 0 ||
|
|
|
|
|
- size.NewValue.Value.Width == 0 || size.NewValue.Value.Height == 0)
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ await Dispatcher.UIThread.InvokeAsync(window.Hide);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (size.Sender != window)
|
|
|
|
|
|
|
+ var vm = window.DataContext as MainViewModel;
|
|
|
|
|
+ string lastFile;
|
|
|
|
|
+ if (NavigationHelper.CanNavigate(vm))
|
|
|
{
|
|
{
|
|
|
- return;
|
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty(ArchiveExtraction.LastOpenedArchive))
|
|
|
|
|
+ {
|
|
|
|
|
+ lastFile = ArchiveExtraction.LastOpenedArchive;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ lastFile = vm?.FileInfo?.FullName ?? FileHistoryNavigation.GetLastFile();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- var x = (size.OldValue.Value.Width - size.NewValue.Value.Width) / 2;
|
|
|
|
|
- var y = (size.OldValue.Value.Height - size.NewValue.Value.Height) / 2;
|
|
|
|
|
-
|
|
|
|
|
- window.Position = new PixelPoint(window.Position.X + (int)x, window.Position.Y + (int)y);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static void CenterWindowOnScreen(bool horizontal = true)
|
|
|
|
|
- {
|
|
|
|
|
- if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
|
|
|
|
|
|
|
+ else
|
|
|
{
|
|
{
|
|
|
- return;
|
|
|
|
|
|
|
+ var url = vm?.Title.GetURL();
|
|
|
|
|
+ lastFile = !string.IsNullOrWhiteSpace(url) ? url : FileHistoryNavigation.GetLastFile();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- Dispatcher.UIThread.Post(() =>
|
|
|
|
|
- {
|
|
|
|
|
- var window = desktop.MainWindow;
|
|
|
|
|
-
|
|
|
|
|
- // Get the screen that the window is currently on
|
|
|
|
|
- var screens = window.Screens;
|
|
|
|
|
- var screen = screens.ScreenFromVisual(window);
|
|
|
|
|
-
|
|
|
|
|
- if (screen == null)
|
|
|
|
|
- {
|
|
|
|
|
- return; // No screen found (edge case)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Get the scaling factor of the screen (DPI scaling)
|
|
|
|
|
- var scalingFactor = screen.Scaling;
|
|
|
|
|
|
|
|
|
|
- // Get the current screen's bounds (in physical pixels, not adjusted for scaling)
|
|
|
|
|
- var screenBounds = screen.WorkingArea;
|
|
|
|
|
-
|
|
|
|
|
- // Calculate the actual bounds in logical units (adjusting for scaling)
|
|
|
|
|
- var screenWidth = screenBounds.Width / scalingFactor;
|
|
|
|
|
- var screenHeight = screenBounds.Height / scalingFactor;
|
|
|
|
|
-
|
|
|
|
|
- // Get the size of the window
|
|
|
|
|
- var windowSize = window.ClientSize;
|
|
|
|
|
-
|
|
|
|
|
- // Calculate the position to center the window on the screen
|
|
|
|
|
- var centeredX = screenBounds.X + (screenWidth - windowSize.Width) / 2;
|
|
|
|
|
- var centeredY = screenBounds.Y + (screenHeight - windowSize.Height) / 2;
|
|
|
|
|
-
|
|
|
|
|
- // Set the window's new position
|
|
|
|
|
- window.Position = horizontal ?
|
|
|
|
|
- new PixelPoint((int)centeredX, (int)centeredY) :
|
|
|
|
|
- new PixelPoint(window.Position.X, (int)centeredY);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ SettingsHelper.Settings.StartUp.LastFile = lastFile;
|
|
|
|
|
+ await SettingsHelper.SaveSettingsAsync();
|
|
|
|
|
+ await KeybindingsHelper.UpdateKeyBindingsFile(); // Save keybindings
|
|
|
|
|
+ FileDeletionHelper.DeleteTempFiles();
|
|
|
|
|
+ FileHistoryNavigation.WriteToFile();
|
|
|
|
|
+ ArchiveExtraction.Cleanup();
|
|
|
|
|
+ Environment.Exit(0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- #endregion Window Dragging and size changing
|
|
|
|
|
-
|
|
|
|
|
- #region Change window behavior
|
|
|
|
|
|
|
+ #region Window State Management
|
|
|
|
|
|
|
|
public static async Task ToggleTopMost(MainViewModel vm)
|
|
public static async Task ToggleTopMost(MainViewModel vm)
|
|
|
{
|
|
{
|
|
@@ -194,7 +103,8 @@ public static class WindowHelper
|
|
|
SettingsHelper.Settings.WindowProperties.AutoFit = true;
|
|
SettingsHelper.Settings.WindowProperties.AutoFit = true;
|
|
|
vm.IsAutoFit = true;
|
|
vm.IsAutoFit = true;
|
|
|
}
|
|
}
|
|
|
- SetSize(vm);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ WindowResizing.SetSize(vm);
|
|
|
await Dispatcher.UIThread.InvokeAsync(() => CenterWindowOnScreen(false));
|
|
await Dispatcher.UIThread.InvokeAsync(() => CenterWindowOnScreen(false));
|
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
|
}
|
|
}
|
|
@@ -209,7 +119,6 @@ public static class WindowHelper
|
|
|
SettingsHelper.Settings.ImageScaling.StretchImage = false;
|
|
SettingsHelper.Settings.ImageScaling.StretchImage = false;
|
|
|
vm.IsStretched = false;
|
|
vm.IsStretched = false;
|
|
|
vm.IsAutoFit = false;
|
|
vm.IsAutoFit = false;
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -220,7 +129,8 @@ public static class WindowHelper
|
|
|
vm.IsAutoFit = true;
|
|
vm.IsAutoFit = true;
|
|
|
vm.IsStretched = true;
|
|
vm.IsStretched = true;
|
|
|
}
|
|
}
|
|
|
- SetSize(vm);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ WindowResizing.SetSize(vm);
|
|
|
await Dispatcher.UIThread.InvokeAsync(() => CenterWindowOnScreen(false));
|
|
await Dispatcher.UIThread.InvokeAsync(() => CenterWindowOnScreen(false));
|
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
|
}
|
|
}
|
|
@@ -230,11 +140,11 @@ public static class WindowHelper
|
|
|
vm.SizeToContent = SizeToContent.Manual;
|
|
vm.SizeToContent = SizeToContent.Manual;
|
|
|
vm.CanResize = true;
|
|
vm.CanResize = true;
|
|
|
SettingsHelper.Settings.WindowProperties.AutoFit = false;
|
|
SettingsHelper.Settings.WindowProperties.AutoFit = false;
|
|
|
- SetSize(vm);
|
|
|
|
|
|
|
+ WindowResizing.SetSize(vm);
|
|
|
vm.ImageViewer.MainImage.InvalidateVisual();
|
|
vm.ImageViewer.MainImage.InvalidateVisual();
|
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static async Task NormalWindowStretch(MainViewModel vm)
|
|
public static async Task NormalWindowStretch(MainViewModel vm)
|
|
|
{
|
|
{
|
|
|
vm.SizeToContent = SizeToContent.Manual;
|
|
vm.SizeToContent = SizeToContent.Manual;
|
|
@@ -242,16 +152,16 @@ public static class WindowHelper
|
|
|
SettingsHelper.Settings.WindowProperties.AutoFit = false;
|
|
SettingsHelper.Settings.WindowProperties.AutoFit = false;
|
|
|
SettingsHelper.Settings.ImageScaling.StretchImage = true;
|
|
SettingsHelper.Settings.ImageScaling.StretchImage = true;
|
|
|
vm.IsStretched = true;
|
|
vm.IsStretched = true;
|
|
|
- SetSize(vm);
|
|
|
|
|
|
|
+ WindowResizing.SetSize(vm);
|
|
|
vm.ImageViewer.MainImage.InvalidateVisual();
|
|
vm.ImageViewer.MainImage.InvalidateVisual();
|
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static async Task Stretch(MainViewModel vm)
|
|
public static async Task Stretch(MainViewModel vm)
|
|
|
{
|
|
{
|
|
|
SettingsHelper.Settings.ImageScaling.StretchImage = true;
|
|
SettingsHelper.Settings.ImageScaling.StretchImage = true;
|
|
|
vm.IsStretched = true;
|
|
vm.IsStretched = true;
|
|
|
- SetSize(vm);
|
|
|
|
|
|
|
+ WindowResizing.SetSize(vm);
|
|
|
vm.ImageViewer.MainImage.InvalidateVisual();
|
|
vm.ImageViewer.MainImage.InvalidateVisual();
|
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
|
}
|
|
}
|
|
@@ -266,22 +176,22 @@ public static class WindowHelper
|
|
|
if (SettingsHelper.Settings.WindowProperties.Fullscreen)
|
|
if (SettingsHelper.Settings.WindowProperties.Fullscreen)
|
|
|
{
|
|
{
|
|
|
vm.IsFullscreen = false;
|
|
vm.IsFullscreen = false;
|
|
|
- await Dispatcher.UIThread.InvokeAsync(() =>
|
|
|
|
|
|
|
+ await Dispatcher.UIThread.InvokeAsync(() =>
|
|
|
desktop.MainWindow.WindowState = WindowState.Normal);
|
|
desktop.MainWindow.WindowState = WindowState.Normal);
|
|
|
if (saveSettings)
|
|
if (saveSettings)
|
|
|
{
|
|
{
|
|
|
SettingsHelper.Settings.WindowProperties.Fullscreen = false;
|
|
SettingsHelper.Settings.WindowProperties.Fullscreen = false;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
{
|
|
{
|
|
|
- RestoreSize(desktop.MainWindow);
|
|
|
|
|
|
|
+ WindowResizing.RestoreSize(desktop.MainWindow);
|
|
|
Restore(vm, desktop);
|
|
Restore(vm, desktop);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- SaveSize(desktop.MainWindow);
|
|
|
|
|
|
|
+ WindowResizing.SaveSize(desktop.MainWindow);
|
|
|
Fullscreen(vm, desktop);
|
|
Fullscreen(vm, desktop);
|
|
|
if (saveSettings)
|
|
if (saveSettings)
|
|
|
{
|
|
{
|
|
@@ -291,13 +201,14 @@ public static class WindowHelper
|
|
|
|
|
|
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static async Task MaximizeRestore()
|
|
public static async Task MaximizeRestore()
|
|
|
{
|
|
{
|
|
|
if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
|
|
if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
var vm = desktop.MainWindow.DataContext as MainViewModel;
|
|
var vm = desktop.MainWindow.DataContext as MainViewModel;
|
|
|
// Restore
|
|
// Restore
|
|
|
if (desktop.MainWindow.WindowState is WindowState.Maximized or WindowState.FullScreen)
|
|
if (desktop.MainWindow.WindowState is WindowState.Maximized or WindowState.FullScreen)
|
|
@@ -309,11 +220,12 @@ public static class WindowHelper
|
|
|
{
|
|
{
|
|
|
if (!SettingsHelper.Settings.WindowProperties.AutoFit)
|
|
if (!SettingsHelper.Settings.WindowProperties.AutoFit)
|
|
|
{
|
|
{
|
|
|
- SaveSize(desktop.MainWindow);
|
|
|
|
|
|
|
+ WindowResizing.SaveSize(desktop.MainWindow);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
Maximize();
|
|
Maximize();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -330,16 +242,18 @@ public static class WindowHelper
|
|
|
vm.IsBottomToolbarShown = true;
|
|
vm.IsBottomToolbarShown = true;
|
|
|
vm.BottombarHeight = SizeDefaults.BottombarHeight;
|
|
vm.BottombarHeight = SizeDefaults.BottombarHeight;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
vm.IsUIShown = true;
|
|
vm.IsUIShown = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- Dispatcher.UIThread.InvokeAsync(() =>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Dispatcher.UIThread.InvokeAsync(() =>
|
|
|
desktop.MainWindow.WindowState = WindowState.Normal);
|
|
desktop.MainWindow.WindowState = WindowState.Normal);
|
|
|
SettingsHelper.Settings.WindowProperties.Maximized = false;
|
|
SettingsHelper.Settings.WindowProperties.Maximized = false;
|
|
|
SettingsHelper.Settings.WindowProperties.Fullscreen = false;
|
|
SettingsHelper.Settings.WindowProperties.Fullscreen = false;
|
|
|
vm.IsUIShown = SettingsHelper.Settings.UIProperties.ShowInterface;
|
|
vm.IsUIShown = SettingsHelper.Settings.UIProperties.ShowInterface;
|
|
|
InitializeWindowSizeAndPosition(desktop.MainWindow);
|
|
InitializeWindowSizeAndPosition(desktop.MainWindow);
|
|
|
- SetSize(vm);
|
|
|
|
|
|
|
+ WindowResizing.SetSize(vm);
|
|
|
if (SettingsHelper.Settings.WindowProperties.AutoFit)
|
|
if (SettingsHelper.Settings.WindowProperties.AutoFit)
|
|
|
{
|
|
{
|
|
|
vm.SizeToContent = SizeToContent.WidthAndHeight;
|
|
vm.SizeToContent = SizeToContent.WidthAndHeight;
|
|
@@ -355,7 +269,7 @@ public static class WindowHelper
|
|
|
public static void Maximize()
|
|
public static void Maximize()
|
|
|
{
|
|
{
|
|
|
// TODO: Fix incorrect size for bottom button bar
|
|
// TODO: Fix incorrect size for bottom button bar
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (Dispatcher.UIThread.CheckAccess())
|
|
if (Dispatcher.UIThread.CheckAccess())
|
|
|
{
|
|
{
|
|
|
Set();
|
|
Set();
|
|
@@ -366,12 +280,14 @@ public static class WindowHelper
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
return;
|
|
|
|
|
+
|
|
|
void Set()
|
|
void Set()
|
|
|
{
|
|
{
|
|
|
if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
|
|
if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
var vm = desktop.MainWindow.DataContext as MainViewModel;
|
|
var vm = desktop.MainWindow.DataContext as MainViewModel;
|
|
|
if (SettingsHelper.Settings.WindowProperties.AutoFit)
|
|
if (SettingsHelper.Settings.WindowProperties.AutoFit)
|
|
|
{
|
|
{
|
|
@@ -380,7 +296,7 @@ public static class WindowHelper
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
desktop.MainWindow.WindowState = WindowState.Maximized;
|
|
desktop.MainWindow.WindowState = WindowState.Maximized;
|
|
|
- SetSize(desktop.MainWindow.DataContext as MainViewModel);
|
|
|
|
|
|
|
+ WindowResizing.SetSize(desktop.MainWindow.DataContext as MainViewModel);
|
|
|
SettingsHelper.Settings.WindowProperties.Maximized = true;
|
|
SettingsHelper.Settings.WindowProperties.Maximized = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -398,7 +314,7 @@ public static class WindowHelper
|
|
|
{
|
|
{
|
|
|
Dispatcher.UIThread.Invoke(() => desktop.MainWindow.WindowState = WindowState.FullScreen);
|
|
Dispatcher.UIThread.Invoke(() => desktop.MainWindow.WindowState = WindowState.FullScreen);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
{
|
|
{
|
|
|
vm.IsTopToolbarShown = false; // Hide interface in fullscreen. Remember to turn back when exiting fullscreen
|
|
vm.IsTopToolbarShown = false; // Hide interface in fullscreen. Remember to turn back when exiting fullscreen
|
|
@@ -446,6 +362,7 @@ public static class WindowHelper
|
|
|
// TODO go to macOS fullscreen mode when auto fit is on
|
|
// TODO go to macOS fullscreen mode when auto fit is on
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
vm.GalleryWidth = double.NaN;
|
|
vm.GalleryWidth = double.NaN;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -455,292 +372,132 @@ public static class WindowHelper
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- await Dispatcher.UIThread.InvokeAsync(() =>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ await Dispatcher.UIThread.InvokeAsync(() =>
|
|
|
desktop.MainWindow.WindowState = WindowState.Minimized);
|
|
desktop.MainWindow.WindowState = WindowState.Minimized);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public static async Task Close()
|
|
public static async Task Close()
|
|
|
{
|
|
{
|
|
|
if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
|
|
if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
|
|
|
{
|
|
{
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- await Dispatcher.UIThread.InvokeAsync(() =>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ await Dispatcher.UIThread.InvokeAsync(() =>
|
|
|
desktop.MainWindow.Close());
|
|
desktop.MainWindow.Close());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- #endregion Change window behavior
|
|
|
|
|
|
|
+ #endregion
|
|
|
|
|
|
|
|
- #region Set and save Size
|
|
|
|
|
|
|
+ #region Window Size and Position
|
|
|
|
|
|
|
|
- public static void SetSize(MainViewModel vm)
|
|
|
|
|
|
|
+ public static void CenterWindowOnScreen(bool horizontal = true)
|
|
|
{
|
|
{
|
|
|
- double firstWidth, firstHeight;
|
|
|
|
|
- var preloadValue = vm.ImageIterator?.GetCurrentPreLoadValue();
|
|
|
|
|
- if (preloadValue == null)
|
|
|
|
|
- {
|
|
|
|
|
- if (vm.FileInfo is null)
|
|
|
|
|
- {
|
|
|
|
|
- if (vm.ImageSource is Bitmap bitmap)
|
|
|
|
|
- {
|
|
|
|
|
- firstWidth = bitmap.PixelSize.Width;
|
|
|
|
|
- firstHeight = bitmap.PixelSize.Height;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- var magickImage = new MagickImage();
|
|
|
|
|
- magickImage.Ping(vm.FileInfo);
|
|
|
|
|
- firstWidth = magickImage.Width;
|
|
|
|
|
- firstHeight = magickImage.Height;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
|
|
+ if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
|
|
|
{
|
|
{
|
|
|
- firstWidth = GetWidth(preloadValue);
|
|
|
|
|
- firstHeight = GetHeight(preloadValue);
|
|
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
- if (SettingsHelper.Settings.ImageScaling.ShowImageSideBySide)
|
|
|
|
|
- {
|
|
|
|
|
- var secondaryPreloadValue = vm.ImageIterator?.GetNextPreLoadValue();
|
|
|
|
|
- double secondWidth, secondHeight;
|
|
|
|
|
- if (secondaryPreloadValue != null)
|
|
|
|
|
- {
|
|
|
|
|
- secondWidth = GetWidth(secondaryPreloadValue);
|
|
|
|
|
- secondHeight = GetHeight(secondaryPreloadValue);
|
|
|
|
|
- }
|
|
|
|
|
- else if (vm.ImageIterator is not null)
|
|
|
|
|
- {
|
|
|
|
|
- var nextIndex = vm.ImageIterator.GetIteration(vm.ImageIterator.CurrentIndex, vm.ImageIterator.IsReversed ? NavigateTo.Previous : NavigateTo.Next);
|
|
|
|
|
- var magickImage = new MagickImage();
|
|
|
|
|
- magickImage.Ping(vm.ImageIterator.ImagePaths[nextIndex]);
|
|
|
|
|
- secondWidth = magickImage.Width;
|
|
|
|
|
- secondHeight = magickImage.Height;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- secondWidth = 0;
|
|
|
|
|
- secondHeight = 0;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- if (Dispatcher.UIThread.CheckAccess())
|
|
|
|
|
- {
|
|
|
|
|
- SetSize(firstWidth, firstHeight, secondWidth, secondHeight, vm.RotationAngle, vm);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- Dispatcher.UIThread.InvokeAsync(() => SetSize(firstWidth, firstHeight, secondWidth, secondHeight, vm.RotationAngle, vm));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
|
|
+ Dispatcher.UIThread.Post(() =>
|
|
|
{
|
|
{
|
|
|
- if (Dispatcher.UIThread.CheckAccess())
|
|
|
|
|
- {
|
|
|
|
|
- SetSize(firstWidth, firstHeight, 0, 0, vm.RotationAngle, vm);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
|
|
+ var window = desktop.MainWindow;
|
|
|
|
|
+
|
|
|
|
|
+ // Get the screen that the window is currently on
|
|
|
|
|
+ var screens = window.Screens;
|
|
|
|
|
+ var screen = screens.ScreenFromVisual(window);
|
|
|
|
|
+
|
|
|
|
|
+ if (screen == null)
|
|
|
{
|
|
{
|
|
|
- Dispatcher.UIThread.InvokeAsync(() => SetSize(firstWidth, firstHeight, 0, 0, vm.RotationAngle, vm));
|
|
|
|
|
|
|
+ return; // No screen found (edge case)
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- return;
|
|
|
|
|
- double GetWidth(PreLoader.PreLoadValue preloadValue)
|
|
|
|
|
- {
|
|
|
|
|
- return preloadValue?.ImageModel?.PixelWidth ?? vm.ImageWidth;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- double GetHeight(PreLoader.PreLoadValue preloadValue)
|
|
|
|
|
- {
|
|
|
|
|
- return preloadValue?.ImageModel?.PixelHeight ?? vm.ImageHeight;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static void SetSize(double width, double height, double secondWidth, double secondHeight, double rotation, MainViewModel vm)
|
|
|
|
|
- {
|
|
|
|
|
- width = width == 0 ? vm.ImageWidth : width;
|
|
|
|
|
- height = height == 0 ? vm.ImageHeight : height;
|
|
|
|
|
- if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop)
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // Get the scaling factor of the screen (DPI scaling)
|
|
|
|
|
+ var scalingFactor = screen.Scaling;
|
|
|
|
|
|
|
|
- var mainView = UIHelper.GetMainView;
|
|
|
|
|
- if (mainView is null)
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // Get the current screen's bounds (in physical pixels, not adjusted for scaling)
|
|
|
|
|
+ var screenBounds = screen.WorkingArea;
|
|
|
|
|
|
|
|
- const int padding = 45;
|
|
|
|
|
- var screenSize = ScreenHelper.ScreenSize;
|
|
|
|
|
- double desktopMinWidth = 0, desktopMinHeight = 0, containerWidth = 0, containerHeight = 0;
|
|
|
|
|
- desktopMinWidth = desktop.MainWindow.MinWidth;
|
|
|
|
|
- desktopMinHeight = desktop.MainWindow.MinHeight;
|
|
|
|
|
- containerWidth = mainView.Bounds.Width;
|
|
|
|
|
- containerHeight = mainView.Bounds.Height;
|
|
|
|
|
|
|
+ // Calculate the actual bounds in logical units (adjusting for scaling)
|
|
|
|
|
+ var screenWidth = screenBounds.Width / scalingFactor;
|
|
|
|
|
+ var screenHeight = screenBounds.Height / scalingFactor;
|
|
|
|
|
|
|
|
- if (double.IsNaN(containerWidth) || double.IsNaN(containerHeight) || double.IsNaN(width) || double.IsNaN(height))
|
|
|
|
|
- {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- ImageSizeCalculationHelper.ImageSize size;
|
|
|
|
|
- if (SettingsHelper.Settings.ImageScaling.ShowImageSideBySide && secondWidth > 0 && secondHeight > 0)
|
|
|
|
|
- {
|
|
|
|
|
- size = ImageSizeCalculationHelper.GetImageSize(
|
|
|
|
|
- width,
|
|
|
|
|
- height,
|
|
|
|
|
- secondWidth,
|
|
|
|
|
- secondHeight,
|
|
|
|
|
- screenSize.WorkingAreaWidth,
|
|
|
|
|
- screenSize.WorkingAreaHeight,
|
|
|
|
|
- desktopMinWidth,
|
|
|
|
|
- desktopMinHeight,
|
|
|
|
|
- ImageSizeCalculationHelper.GetInterfaceSize(),
|
|
|
|
|
- rotation,
|
|
|
|
|
- padding,
|
|
|
|
|
- screenSize.Scaling,
|
|
|
|
|
- vm.TitlebarHeight,
|
|
|
|
|
- vm.BottombarHeight,
|
|
|
|
|
- vm.GalleryHeight,
|
|
|
|
|
- containerWidth,
|
|
|
|
|
- containerHeight);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- size = ImageSizeCalculationHelper.GetImageSize(
|
|
|
|
|
- width,
|
|
|
|
|
- height,
|
|
|
|
|
- screenSize.WorkingAreaWidth,
|
|
|
|
|
- screenSize.WorkingAreaHeight,
|
|
|
|
|
- desktopMinWidth,
|
|
|
|
|
- desktopMinHeight,
|
|
|
|
|
- ImageSizeCalculationHelper.GetInterfaceSize(),
|
|
|
|
|
- rotation,
|
|
|
|
|
- padding,
|
|
|
|
|
- screenSize.Scaling,
|
|
|
|
|
- vm.TitlebarHeight,
|
|
|
|
|
- vm.BottombarHeight,
|
|
|
|
|
- vm.GalleryHeight,
|
|
|
|
|
- containerWidth,
|
|
|
|
|
- containerHeight);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- vm.TitleMaxWidth = size.TitleMaxWidth;
|
|
|
|
|
- vm.ImageWidth = size.Width;
|
|
|
|
|
- vm.SecondaryImageWidth = size.SecondaryWidth;
|
|
|
|
|
- vm.ImageHeight = size.Height;
|
|
|
|
|
- vm.GalleryMargin = new Thickness(0, 0, 0, size.Margin);
|
|
|
|
|
-
|
|
|
|
|
- vm.ScrollViewerWidth = size.ScrollViewerWidth;
|
|
|
|
|
- vm.ScrollViewerHeight = size.ScrollViewerHeight;
|
|
|
|
|
|
|
+ // Get the size of the window
|
|
|
|
|
+ var windowSize = window.ClientSize;
|
|
|
|
|
|
|
|
- if (SettingsHelper.Settings.WindowProperties.AutoFit)
|
|
|
|
|
- {
|
|
|
|
|
- if (SettingsHelper.Settings.WindowProperties.Fullscreen || SettingsHelper.Settings.WindowProperties.Maximized)
|
|
|
|
|
- {
|
|
|
|
|
- vm.GalleryWidth = double.NaN;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- vm.GalleryWidth = vm.RotationAngle is 90 or 270 ?
|
|
|
|
|
- Math.Max(size.Height, desktopMinHeight) :
|
|
|
|
|
- Math.Max(size.Width, desktopMinWidth);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- vm.GalleryWidth = double.NaN;;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static void SaveSize(Window window)
|
|
|
|
|
- {
|
|
|
|
|
- if (Dispatcher.UIThread.CheckAccess())
|
|
|
|
|
- {
|
|
|
|
|
- Set();
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- Dispatcher.UIThread.InvokeAsync(Set);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // Calculate the position to center the window on the screen
|
|
|
|
|
+ var centeredX = screenBounds.X + (screenWidth - windowSize.Width) / 2;
|
|
|
|
|
+ var centeredY = screenBounds.Y + (screenHeight - windowSize.Height) / 2;
|
|
|
|
|
|
|
|
- return;
|
|
|
|
|
- void Set()
|
|
|
|
|
- {
|
|
|
|
|
- var top = window.Position.Y;
|
|
|
|
|
- var left = window.Position.X;
|
|
|
|
|
- SettingsHelper.Settings.WindowProperties.Top = top;
|
|
|
|
|
- SettingsHelper.Settings.WindowProperties.Left = left;
|
|
|
|
|
- SettingsHelper.Settings.WindowProperties.Width = window.Width;
|
|
|
|
|
- SettingsHelper.Settings.WindowProperties.Height = window.Height;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // Set the window's new position
|
|
|
|
|
+ window.Position = horizontal
|
|
|
|
|
+ ? new PixelPoint((int)centeredX, (int)centeredY)
|
|
|
|
|
+ : new PixelPoint(window.Position.X, (int)centeredY);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- public static void RestoreSize(Window window)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public static void InitializeWindowSizeAndPosition(Window window)
|
|
|
{
|
|
{
|
|
|
if (Dispatcher.UIThread.CheckAccess())
|
|
if (Dispatcher.UIThread.CheckAccess())
|
|
|
{
|
|
{
|
|
|
- Set();
|
|
|
|
|
|
|
+ window.Position = new PixelPoint((int)SettingsHelper.Settings.WindowProperties.Left,
|
|
|
|
|
+ (int)SettingsHelper.Settings.WindowProperties.Top);
|
|
|
|
|
+ window.Width = SettingsHelper.Settings.WindowProperties.Width;
|
|
|
|
|
+ window.Height = SettingsHelper.Settings.WindowProperties.Height;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- Dispatcher.UIThread.InvokeAsync(Set);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return;
|
|
|
|
|
- void Set()
|
|
|
|
|
- {
|
|
|
|
|
- var x = (int)SettingsHelper.Settings.WindowProperties.Left;
|
|
|
|
|
- var y = (int)SettingsHelper.Settings.WindowProperties.Top;
|
|
|
|
|
- window.Position = new PixelPoint(x, y);
|
|
|
|
|
- window.Width = SettingsHelper.Settings.WindowProperties.Width;
|
|
|
|
|
- window.Height = SettingsHelper.Settings.WindowProperties.Height;
|
|
|
|
|
|
|
+ Dispatcher.UIThread.InvokeAsync(() =>
|
|
|
|
|
+ {
|
|
|
|
|
+ window.Position = new PixelPoint((int)SettingsHelper.Settings.WindowProperties.Left,
|
|
|
|
|
+ (int)SettingsHelper.Settings.WindowProperties.Top);
|
|
|
|
|
+ window.Width = SettingsHelper.Settings.WindowProperties.Width;
|
|
|
|
|
+ window.Height = SettingsHelper.Settings.WindowProperties.Height;
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
- public static async Task WindowClosingBehavior(Window window)
|
|
|
|
|
|
|
+ #region Window Drag and Behavior
|
|
|
|
|
+
|
|
|
|
|
+ public static void WindowDragAndDoubleClickBehavior(Window window, PointerPressedEventArgs e)
|
|
|
{
|
|
{
|
|
|
- if (Dispatcher.UIThread.CheckAccess())
|
|
|
|
|
- {
|
|
|
|
|
- window.Hide();
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
|
|
+ if (e.ClickCount == 2 && e.GetCurrentPoint(window).Properties.IsLeftButtonPressed)
|
|
|
{
|
|
{
|
|
|
- await Dispatcher.UIThread.InvokeAsync(window.Hide);
|
|
|
|
|
|
|
+ _ = MaximizeRestore();
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!SettingsHelper.Settings.WindowProperties.Maximized || !SettingsHelper.Settings.WindowProperties.Fullscreen || SettingsHelper.Settings.WindowProperties.AutoFit)
|
|
|
|
|
- {
|
|
|
|
|
- SaveSize(window);
|
|
|
|
|
- }
|
|
|
|
|
- var vm = window.DataContext as MainViewModel;
|
|
|
|
|
- string lastFile;
|
|
|
|
|
- if (NavigationHelper.CanNavigate(vm))
|
|
|
|
|
|
|
+ var currentScreen = ScreenHelper.ScreenSize;
|
|
|
|
|
+ window.BeginMoveDrag(e);
|
|
|
|
|
+ var screen = window.Screens.ScreenFromVisual(window);
|
|
|
|
|
+ if (screen != null)
|
|
|
{
|
|
{
|
|
|
- if (!string.IsNullOrEmpty(ArchiveExtraction.LastOpenedArchive))
|
|
|
|
|
- {
|
|
|
|
|
- lastFile = ArchiveExtraction.LastOpenedArchive;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
|
|
+ if (screen.WorkingArea.Width != currentScreen.WorkingAreaWidth ||
|
|
|
|
|
+ screen.WorkingArea.Height != currentScreen.WorkingAreaHeight || screen.Scaling != currentScreen.Scaling)
|
|
|
{
|
|
{
|
|
|
- lastFile = vm?.FileInfo?.FullName ?? FileHistoryNavigation.GetLastFile();
|
|
|
|
|
|
|
+ ScreenHelper.UpdateScreenSize(window);
|
|
|
|
|
+ WindowResizing.SetSize(window.DataContext as MainViewModel);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static void WindowDragBehavior(Window window, PointerPressedEventArgs e)
|
|
|
|
|
+ {
|
|
|
|
|
+ var currentScreen = ScreenHelper.ScreenSize;
|
|
|
|
|
+ window.BeginMoveDrag(e);
|
|
|
|
|
+ var screen = window.Screens.ScreenFromVisual(window);
|
|
|
|
|
+ if (screen != null)
|
|
|
{
|
|
{
|
|
|
- var url = vm?.Title.GetURL();
|
|
|
|
|
- lastFile = !string.IsNullOrWhiteSpace(url) ? url : FileHistoryNavigation.GetLastFile();
|
|
|
|
|
|
|
+ if (screen.WorkingArea.Width != currentScreen.WorkingAreaWidth ||
|
|
|
|
|
+ screen.WorkingArea.Height != currentScreen.WorkingAreaHeight || screen.Scaling != currentScreen.Scaling)
|
|
|
|
|
+ {
|
|
|
|
|
+ ScreenHelper.UpdateScreenSize(window);
|
|
|
|
|
+ WindowResizing.SetSize(window.DataContext as MainViewModel);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- SettingsHelper.Settings.StartUp.LastFile = lastFile;
|
|
|
|
|
- await SettingsHelper.SaveSettingsAsync();
|
|
|
|
|
- await KeybindingsHelper.UpdateKeyBindingsFile(); // Save keybindings
|
|
|
|
|
- FileDeletionHelper.DeleteTempFiles();
|
|
|
|
|
- FileHistoryNavigation.WriteToFile();
|
|
|
|
|
- ArchiveExtraction.Cleanup();
|
|
|
|
|
- Environment.Exit(0);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ #endregion
|
|
|
}
|
|
}
|