我有一个方法,它有一个线程,下一个幻灯片有powerpoint持续时间。但在关闭演示文稿后,我需要检查它是否有效。 但我无法弄明白。你能帮我解决这个问题吗?
private void Play()
{
try
{
while (mainForm._slideIndex <= mainForm._slidescount)
{
if (mainForm._presentation.Slides._Index(1) != null)
{
Thread.Sleep((int)mainForm._oSlideShowView.Slide.SlideShowTransition.Duration * 500);
}
if (mainForm._slideIndex == mainForm._slidescount)
{
if (mainForm._oSlideShowView != null)
{
mainForm._oSlideShowView.First();
mainForm._slideIndex = 1;
}
}
if (mainForm._slideIndex <= mainForm._slidescount)
{
if (mainForm._oSlideShowView != null)
{
mainForm._oSlideShowView.Next();
mainForm._slideIndex++;
}
}
if (mainForm._presentation.Slides._Index(1) != null)
{
Thread.Sleep((int)mainForm._oSlideShowView.Slide.SlideShowTransition.Duration * 500);
}
}
}
catch (Exception exp)
{
throw new Exception();
}
}