add:双联动架构
This commit is contained in:
@@ -13,20 +13,21 @@ namespace Ink_Canvas.Helpers
|
||||
/// <summary>
|
||||
/// 基于 COM 的 PPT 联动管理器
|
||||
/// </summary>
|
||||
public class ComPPTManager : IDisposable
|
||||
public class ComPPTManager : IPPTLinkManager
|
||||
{
|
||||
#region Events
|
||||
public event Action<SlideShowWindow> SlideShowBegin;
|
||||
public event Action<SlideShowWindow> SlideShowNextSlide;
|
||||
public event Action<Presentation> SlideShowEnd;
|
||||
public event Action<Presentation> PresentationOpen;
|
||||
public event Action<Presentation> PresentationClose;
|
||||
public event Action<object> SlideShowBegin;
|
||||
public event Action<object> SlideShowNextSlide;
|
||||
public event Action<object> SlideShowEnd;
|
||||
public event Action<object> PresentationOpen;
|
||||
public event Action<object> PresentationClose;
|
||||
public event Action<bool> PPTConnectionChanged;
|
||||
public event Action<bool> SlideShowStateChanged;
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
public Microsoft.Office.Interop.PowerPoint.Application PPTApplication { get; private set; }
|
||||
object IPPTLinkManager.PPTApplication => PPTApplication;
|
||||
public Presentation CurrentPresentation { get; private set; }
|
||||
public Slides CurrentSlides { get; private set; }
|
||||
public Slide CurrentSlide { get; private set; }
|
||||
@@ -961,7 +962,7 @@ namespace Ink_Canvas.Helpers
|
||||
}
|
||||
}
|
||||
|
||||
public Presentation GetCurrentActivePresentation()
|
||||
public object GetCurrentActivePresentation()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using Microsoft.Office.Interop.PowerPoint;
|
||||
|
||||
namespace Ink_Canvas.Helpers
|
||||
{
|
||||
public interface IPPTLinkManager : IDisposable
|
||||
{
|
||||
event Action<object> SlideShowBegin;
|
||||
event Action<object> SlideShowNextSlide;
|
||||
event Action<object> SlideShowEnd;
|
||||
event Action<object> PresentationOpen;
|
||||
event Action<object> PresentationClose;
|
||||
event Action<bool> PPTConnectionChanged;
|
||||
event Action<bool> SlideShowStateChanged;
|
||||
|
||||
bool IsConnected { get; }
|
||||
bool IsInSlideShow { get; }
|
||||
bool IsSupportWPS { get; set; }
|
||||
int SlidesCount { get; }
|
||||
|
||||
object PPTApplication { get; }
|
||||
|
||||
// 生命周期管理
|
||||
void StartMonitoring();
|
||||
void StopMonitoring();
|
||||
|
||||
// 放映控制
|
||||
bool TryStartSlideShow();
|
||||
bool TryEndSlideShow();
|
||||
|
||||
// 导航控制
|
||||
bool TryNavigateToSlide(int slideNumber);
|
||||
bool TryNavigateNext();
|
||||
bool TryNavigatePrevious();
|
||||
|
||||
// 查询
|
||||
int GetCurrentSlideNumber();
|
||||
string GetPresentationName();
|
||||
bool TryShowSlideNavigation();
|
||||
object GetCurrentActivePresentation();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,13 +17,14 @@ namespace Ink_Canvas.Helpers
|
||||
/// <summary>
|
||||
/// PPT联动管理器 - 统一管理PPT和WPS的连接、事件处理和进程管理
|
||||
/// </summary>
|
||||
public class PPTManager : IDisposable
|
||||
public class PPTManager : IPPTLinkManager
|
||||
{
|
||||
#region Events
|
||||
public event Action<object> SlideShowBegin;
|
||||
public event Action<object> SlideShowNextSlide;
|
||||
public event Action<object> SlideShowEnd;
|
||||
public event Action<object> PresentationOpen;
|
||||
public event Action<object> PresentationClose;
|
||||
public event Action<bool> PPTConnectionChanged;
|
||||
public event Action<bool> SlideShowStateChanged;
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user