Skip to content

Commit

Permalink
修复议题 #128 的条目一(议题周边:文字改动)
Browse files Browse the repository at this point in the history
  • Loading branch information
NetheriteBowl committed Jun 16, 2024
1 parent 1b6d0cc commit 14e3368
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
44 changes: 24 additions & 20 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 All @@ -2413,7 +2416,7 @@ private void TimerCheckPPT_Elapsed(object sender, ElapsedEventArgs e)
if (isHaveHiddenSlide && !IsShowingRestoreHiddenSlidesWindow)
{
IsShowingRestoreHiddenSlidesWindow = true;
new YesOrNoNotificationWindow("检测到此演示文档中包含隐藏的幻灯片,是否取消隐藏?",
new YesOrNoNotificationWindow("检测到此演示文稿包含隐藏的幻灯片,是否取消隐藏?",
() =>
{
foreach (Slide slide in slides)
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
2 changes: 1 addition & 1 deletion Ink Canvas/YesOrNoNotificationWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:local="clr-namespace:Ink_Canvas" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d" Topmost="True" WindowStartupLocation="CenterScreen" ui:WindowHelper.UseModernWindowStyle="True"
ResizeMode="NoResize" Closed="Window_Closed" ui:ThemeManager.RequestedTheme="Light"
Title="演示文档设置 - Ink Canvas 画板" Height="160" Width="450" FontFamily="Microsoft YaHei UI">
Title="提示 - Ink Canvas 画板" Height="160" Width="450" FontFamily="Microsoft YaHei UI">
<Grid>
<Grid Margin="10">
<Grid.RowDefinitions>
Expand Down

0 comments on commit 14e3368

Please sign in to comment.