Remvoe dead codes

This commit is contained in:
Paddy Xu
2021-01-10 15:40:45 +01:00
parent ed9334b4b6
commit 88fa00f05a
2 changed files with 4 additions and 31 deletions

View File

@@ -52,7 +52,7 @@ namespace QuickLook
if (focus != NativeMethods.QuickLook.FocusedWindowType.Invalid)
{
StopFocusMonitor();
_viewerWindow.BeginHide();
_viewerWindow.Close();
return;
}
@@ -61,7 +61,7 @@ namespace QuickLook
return;
StopFocusMonitor();
_viewerWindow.RunAndHide();
_viewerWindow.RunAndClose();
}
public void ClosePreview()
@@ -70,7 +70,7 @@ namespace QuickLook
return;
StopFocusMonitor();
_viewerWindow.BeginHide();
_viewerWindow.Close();
}
public void TogglePreview(string path = null)
@@ -151,7 +151,7 @@ namespace QuickLook
{
var plugin = _viewerWindow.Plugin?.GetType();
_viewerWindow.BeginHide();
_viewerWindow.Close();
TrayIconManager.ShowNotification($"Failed to preview {Path.GetFileName(path)}",
"Consider reporting this incident to QuickLooks author.", true);

View File

@@ -49,12 +49,6 @@ namespace QuickLook
}
}
internal void RunAndHide()
{
Run();
BeginHide();
}
internal void RunAndClose()
{
Run();
@@ -261,27 +255,6 @@ namespace QuickLook
buttonOpen.ToolTip = string.Format(TranslationHelper.Get("MW_Open"), Path.GetFileName(_path));
}
internal void BeginHide()
{
// reset custom window size
_customWindowSize = Size.Empty;
_ignoreNextWindowSizeChange = true;
UnloadPlugin();
// if the this window is hidden in Max state, new show() will results in failure:
// "Cannot show Window when ShowActivated is false and WindowState is set to Maximized"
//WindowState = WindowState.Normal;
Hide();
//Dispatcher.BeginInvoke(new Action(Hide), DispatcherPriority.ApplicationIdle);
ViewWindowManager.GetInstance().ForgetCurrentWindow();
Close();
ProcessHelper.PerformAggressiveGC();
}
protected override void OnClosing(CancelEventArgs e)
{
UnloadPlugin();