mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-13 02:49:06 +00:00
Shutdown in Viewer mode on Exception.
This commit is contained in:
@@ -30,7 +30,7 @@ namespace QuickLook
|
|||||||
BlurWindow.EnableWindowBlur(this);
|
BlurWindow.EnableWindowBlur(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
buttonCloseWindow.MouseLeftButtonUp += (sender, e) => Hide();
|
buttonCloseWindow.MouseLeftButtonUp += (sender, e) => BeginHide(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContextObject ContextObject { get; private set; }
|
public ContextObject ContextObject { get; private set; }
|
||||||
@@ -85,9 +85,6 @@ namespace QuickLook
|
|||||||
|
|
||||||
private new void Hide()
|
private new void Hide()
|
||||||
{
|
{
|
||||||
if (App.RunningAsViewer)
|
|
||||||
Application.Current.Shutdown();
|
|
||||||
|
|
||||||
UnloadPlugin();
|
UnloadPlugin();
|
||||||
ContextObject.Reset();
|
ContextObject.Reset();
|
||||||
|
|
||||||
@@ -131,8 +128,14 @@ namespace QuickLook
|
|||||||
throw thrown;
|
throw thrown;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal bool BeginHide()
|
internal bool BeginHide(bool quit = false)
|
||||||
{
|
{
|
||||||
|
if (quit && App.RunningAsViewer)
|
||||||
|
{
|
||||||
|
Application.Current.Shutdown();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (Visibility != Visibility.Visible)
|
if (Visibility != Visibility.Visible)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user