fix:PPT上次页数记忆跳转
This commit is contained in:
@@ -678,14 +678,25 @@ namespace Ink_Canvas.Helpers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!IsConnected || !IsInSlideShow || PPTApplication == null) return false;
|
if (!IsConnected || PPTApplication == null) return false;
|
||||||
if (!Marshal.IsComObject(PPTApplication)) return false;
|
if (!Marshal.IsComObject(PPTApplication)) return false;
|
||||||
|
|
||||||
var slideShowWindow = PPTApplication.SlideShowWindows[1];
|
if (IsInSlideShow && PPTApplication.SlideShowWindows.Count >= 1)
|
||||||
if (slideShowWindow?.View != null)
|
|
||||||
{
|
{
|
||||||
slideShowWindow.View.GotoSlide(slideNumber);
|
var slideShowWindow = PPTApplication.SlideShowWindows[1];
|
||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -960,7 +960,24 @@ namespace Ink_Canvas
|
|||||||
_lastPlaybackPage = page;
|
_lastPlaybackPage = page;
|
||||||
new YesOrNoNotificationWindow($"上次播放到了第 {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();
|
}).ShowDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user