|
15 | 15 | using Application = System.Windows.Application; |
16 | 16 | using File = System.IO.File; |
17 | 17 | using MessageBox = System.Windows.MessageBox; |
| 18 | +using Microsoft.Office.Core; |
18 | 19 |
|
19 | 20 | namespace Ink_Canvas { |
20 | 21 | public partial class MainWindow : Window { |
@@ -175,17 +176,25 @@ private void TimerCheckPPT_Elapsed(object sender, ElapsedEventArgs e) { |
175 | 176 |
|
176 | 177 | //检测是否有自动播放 |
177 | 178 | if (Settings.PowerPointSettings.IsNotifyAutoPlayPresentation |
178 | | - && presentation.SlideShowSettings.AdvanceMode == PpSlideShowAdvanceMode.ppSlideShowUseSlideTimings |
| 179 | + // && presentation.SlideShowSettings.AdvanceMode == PpSlideShowAdvanceMode.ppSlideShowUseSlideTimings |
179 | 180 | && BtnPPTSlideShowEnd.Visibility != Visibility.Visible) { |
180 | | - |
181 | | - Application.Current.Dispatcher.BeginInvoke((Action)(() => |
182 | | - { |
183 | | - new YesOrNoNotificationWindow("检测到此演示文档中自动播放或排练计时已经启用,可能导致幻灯片自动翻页,是否取消?", |
184 | | - () => { |
185 | | - presentation.SlideShowSettings.AdvanceMode = PpSlideShowAdvanceMode.ppSlideShowManualAdvance; |
186 | | - }).ShowDialog(); |
187 | | - })); |
188 | | - presentation.SlideShowSettings.AdvanceMode = PpSlideShowAdvanceMode.ppSlideShowManualAdvance; |
| 181 | + bool hasSlideTimings = false; |
| 182 | + foreach (Slide slide in presentation.Slides) { |
| 183 | + if (slide.SlideShowTransition.AdvanceOnTime == MsoTriState.msoTrue && slide.SlideShowTransition.AdvanceTime > 0) { |
| 184 | + hasSlideTimings = true; |
| 185 | + break; |
| 186 | + } |
| 187 | + } |
| 188 | + if (hasSlideTimings) { |
| 189 | + Application.Current.Dispatcher.BeginInvoke((Action)(() => |
| 190 | + { |
| 191 | + new YesOrNoNotificationWindow("检测到此演示文档中自动播放或排练计时已经启用,可能导致幻灯片自动翻页,是否取消?", |
| 192 | + () => { |
| 193 | + presentation.SlideShowSettings.AdvanceMode = PpSlideShowAdvanceMode.ppSlideShowManualAdvance; |
| 194 | + }).ShowDialog(); |
| 195 | + })); |
| 196 | + presentation.SlideShowSettings.AdvanceMode = PpSlideShowAdvanceMode.ppSlideShowManualAdvance; |
| 197 | + } |
189 | 198 | } |
190 | 199 |
|
191 | 200 | //如果检测到已经开始放映,则立即进入画板模式 |
|
0 commit comments