Skip to content

Commit

Permalink
修复议题 #128 的条目一
Browse files Browse the repository at this point in the history
  • Loading branch information
NetheriteBowl committed Jun 15, 2024
1 parent 1b6d0cc commit df73439
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions Ink Canvas/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2314,6 +2314,8 @@ private void ToggleSwitchSupportWPS_Toggled(object sender, RoutedEventArgs e)

public static bool IsShowingRestoreHiddenSlidesWindow = false;

public static bool IsNotifyPreviousPageWindowShown = false;

private void TimerCheckPPT_Elapsed(object sender, ElapsedEventArgs e)
{
if (IsShowingRestoreHiddenSlidesWindow) return;
Expand Down Expand Up @@ -2369,30 +2371,31 @@ private void TimerCheckPPT_Elapsed(object sender, ElapsedEventArgs e)
// 跳转到上次播放页
if (Settings.PowerPointSettings.IsNotifyPreviousPage)
Application.Current.Dispatcher.BeginInvoke(() =>
{
string defaultFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) +
@"\Ink Canvas Strokes\Auto Saved\Presentations\";
string folderPath = defaultFolderPath + presentation.Name + "_" + presentation.Slides.Count;
if (File.Exists(folderPath + "/Position"))
{
if (int.TryParse(File.ReadAllText(folderPath + "/Position"), out var page))
string defaultFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) +
@"\Ink Canvas Strokes\Auto Saved\Presentations\";
string folderPath = defaultFolderPath + presentation.Name + "_" + presentation.Slides.Count;
if (File.Exists(folderPath + "/Position") & !IsNotifyPreviousPageWindowShown) //判断是否已存在NotifyPreviousPage窗口
{
if (page <= 0) return;
new YesOrNoNotificationWindow($"上次播放到了第 {page} 页, 是否立即跳转", () =>
if (int.TryParse(File.ReadAllText(folderPath + "/Position"), out var page))
{
if (pptApplication.SlideShowWindows.Count >= 1)
{
// 如果已经播放了的话, 跳转
presentation.SlideShowWindow.View.GotoSlide(page);
}
else
IsNotifyPreviousPageWindowShown= true;
if (page <= 0) return;
new YesOrNoNotificationWindow($"上次播放到了第 {page} 页, 是否立即跳转", () =>
{
presentation.Windows[1].View.GotoSlide(page);
}
}).ShowDialog();
if (pptApplication.SlideShowWindows.Count >= 1)
{
// 如果已经播放了的话, 跳转
presentation.SlideShowWindow.View.GotoSlide(page);
}
else
{
presentation.Windows[1].View.GotoSlide(page);
}
}).ShowDialog();
}
}
}
}, DispatcherPriority.Normal);
}, DispatcherPriority.Normal);


//检查是否有隐藏幻灯片
Expand Down Expand Up @@ -2871,6 +2874,7 @@ private void BtnPPTSlideShowEnd_Click(object sender, RoutedEventArgs e)
ms.Position = 0;
memoryStreams[pptApplication.SlideShowWindows[1].View.CurrentShowPosition] = ms;
timeMachine.ClearStrokeHistory();
IsNotifyPreviousPageWindowShown = false;
}
catch { }
});
Expand Down

0 comments on commit df73439

Please sign in to comment.