fix:PPT上次页数记忆跳转
This commit is contained in:
@@ -678,14 +678,25 @@ namespace Ink_Canvas.Helpers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!IsConnected || !IsInSlideShow || PPTApplication == null) return false;
|
||||
if (!IsConnected || PPTApplication == null) return false;
|
||||
if (!Marshal.IsComObject(PPTApplication)) return false;
|
||||
|
||||
var slideShowWindow = PPTApplication.SlideShowWindows[1];
|
||||
if (slideShowWindow?.View != null)
|
||||
if (IsInSlideShow && PPTApplication.SlideShowWindows.Count >= 1)
|
||||
{
|
||||
slideShowWindow.View.GotoSlide(slideNumber);
|
||||
return true;
|
||||
var slideShowWindow = PPTApplication.SlideShowWindows[1];
|
||||
if (slideShowWindow?.View != null)
|
||||
{
|
||||
slideShowWindow.View.GotoSlide(slideNumber);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (CurrentPresentation != null)
|
||||
{
|
||||
if (CurrentPresentation.Windows?.Count >= 1)
|
||||
{
|
||||
CurrentPresentation.Windows[1].View.GotoSlide(slideNumber);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -960,7 +960,24 @@ namespace Ink_Canvas
|
||||
_lastPlaybackPage = page;
|
||||
new YesOrNoNotificationWindow($"上次播放到了第 {page} 页, 是否立即跳转", () =>
|
||||
{
|
||||
_shouldNavigateToLastPage = true;
|
||||
try
|
||||
{
|
||||
if (_pptManager?.PPTApplication != null)
|
||||
{
|
||||
if (_pptManager.PPTApplication.SlideShowWindows.Count >= 1)
|
||||
{
|
||||
pres.SlideShowWindow.View.GotoSlide(page);
|
||||
}
|
||||
else
|
||||
{
|
||||
pres.Windows[1].View.GotoSlide(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"跳转到第{page}页失败: {ex}", LogHelper.LogType.Error);
|
||||
}
|
||||
}).ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user