improve:PPT联动
This commit is contained in:
@@ -20,10 +20,10 @@ namespace Ink_Canvas.Helpers
|
|||||||
public class PPTManager : IDisposable
|
public class PPTManager : IDisposable
|
||||||
{
|
{
|
||||||
#region Events
|
#region Events
|
||||||
public event Action<SlideShowWindow> SlideShowBegin;
|
public event Action<object> SlideShowBegin;
|
||||||
public event Action<SlideShowWindow> SlideShowNextSlide;
|
public event Action<object> SlideShowNextSlide;
|
||||||
public event Action<Presentation> SlideShowEnd;
|
public event Action<object> SlideShowEnd;
|
||||||
public event Action<Presentation> PresentationOpen;
|
public event Action<object> PresentationOpen;
|
||||||
public event Action<bool> PPTConnectionChanged;
|
public event Action<bool> PPTConnectionChanged;
|
||||||
public event Action<bool> SlideShowStateChanged;
|
public event Action<bool> SlideShowStateChanged;
|
||||||
#endregion
|
#endregion
|
||||||
@@ -398,31 +398,7 @@ namespace Ink_Canvas.Helpers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_updateTime = DateTime.Now;
|
OnSlideShowBegin(_pptSlideShowWindow);
|
||||||
_lastPolledSlideNumber = -1;
|
|
||||||
|
|
||||||
if (_pptActivePresentation != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
int currentPage = GetCurrentSlideIndex(_pptSlideShowWindow);
|
|
||||||
int totalPage = GetTotalSlideIndex(_pptActivePresentation);
|
|
||||||
|
|
||||||
if (currentPage >= totalPage) _polling = 1;
|
|
||||||
else _polling = 0;
|
|
||||||
|
|
||||||
SlidesCount = totalPage;
|
|
||||||
_lastPolledSlideNumber = currentPage;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
_polling = 1;
|
|
||||||
_lastPolledSlideNumber = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateCurrentPresentationInfo();
|
|
||||||
SlideShowBegin?.Invoke(_pptSlideShowWindow);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -1500,7 +1476,7 @@ namespace Ink_Canvas.Helpers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSlideShowBegin(SlideShowWindow wn)
|
private void OnSlideShowBegin(object wn)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -519,7 +519,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPPTPresentationOpen(Presentation pres)
|
private void OnPPTPresentationOpen(object pres)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -610,7 +610,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void OnPPTSlideShowBegin(SlideShowWindow wn)
|
private async void OnPPTSlideShowBegin(object wn)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -785,7 +785,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPPTSlideShowNextSlide(SlideShowWindow wn)
|
private void OnPPTSlideShowNextSlide(object wn)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -815,7 +815,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void OnPPTSlideShowEnd(Presentation pres)
|
private async void OnPPTSlideShowEnd(object pres)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user