diff --git a/zoom_sdk_c_sharp_wrap/meeting_configuration_dotnet_wrap.cpp b/zoom_sdk_c_sharp_wrap/meeting_configuration_dotnet_wrap.cpp index 1bb0f61..3e88863 100644 --- a/zoom_sdk_c_sharp_wrap/meeting_configuration_dotnet_wrap.cpp +++ b/zoom_sdk_c_sharp_wrap/meeting_configuration_dotnet_wrap.cpp @@ -5,6 +5,106 @@ namespace ZOOM_SDK_DOTNET_WRAP { //translate event + private ref class CIWebinarNeedRegisterHandler : public IWebinarNeedRegisterHandler + { + public: + CIWebinarNeedRegisterHandler(ZOOM_SDK_NAMESPACE::IWebinarNeedRegisterHandler* pHandler) + { + m_pHandler = pHandler; + } + + ~CIWebinarNeedRegisterHandler() + { + + } + + virtual WebinarNeedRegisterType GetWebinarNeedRegisterType() + { + if (m_pHandler) + return (WebinarNeedRegisterType)m_pHandler->GetWebinarNeedRegisterType(); + + return WebinarNeedRegisterType::WebinarReg_NONE; + } + + private: + ZOOM_SDK_NAMESPACE::IWebinarNeedRegisterHandler* m_pHandler; + }; + + private ref class CIWebinarNeedRegisterHandlerByEmail sealed : public CIWebinarNeedRegisterHandler, IWebinarNeedRegisterHandlerByEmail + { + public: + CIWebinarNeedRegisterHandlerByEmail(ZOOM_SDK_NAMESPACE::IWebinarNeedRegisterHandlerByEmail* pHandler) : CIWebinarNeedRegisterHandler(pHandler) + { + m_pHandler = pHandler; + } + + ~CIWebinarNeedRegisterHandlerByEmail() + { + + } + + virtual SDKError InputWebinarRegisterEmailAndScreenName(String^ email, String^ username) + { + if (m_pHandler) + return (SDKError)m_pHandler->InputWebinarRegisterEmailAndScreenName(PlatformString2WChar(email), PlatformString2WChar(username)); + + return SDKError::SDKERR_UNINITIALIZE; + } + + virtual void Cancel() + { + if (m_pHandler) + m_pHandler->Cancel(); + } + + private: + ZOOM_SDK_NAMESPACE::IWebinarNeedRegisterHandlerByEmail* m_pHandler; + }; + + private ref class CIWebinarNeedRegisterHandlerByUrl sealed : public CIWebinarNeedRegisterHandler, IWebinarNeedRegisterHandlerByUrl + { + public: + CIWebinarNeedRegisterHandlerByUrl(ZOOM_SDK_NAMESPACE::IWebinarNeedRegisterHandlerByUrl* pHandler) : CIWebinarNeedRegisterHandler(pHandler) + { + m_pHandler = pHandler; + } + + ~CIWebinarNeedRegisterHandlerByUrl() + { + + } + + virtual String^ GetWebinarRegisterUrl() + { + if (m_pHandler) + return WChar2PlatformString(m_pHandler->GetWebinarRegisterUrl()); + return nullptr; + } + virtual void Release() + { + if (m_pHandler) + m_pHandler->Release(); + } + + private: + ZOOM_SDK_NAMESPACE::IWebinarNeedRegisterHandlerByUrl* m_pHandler; + }; + + IWebinarNeedRegisterHandler^ TranslateWebinarNeedRegisterHandler(ZOOM_SDK_NAMESPACE::IWebinarNeedRegisterHandler* pHandler) + { + if (pHandler) + { + WebinarNeedRegisterType registerType = (WebinarNeedRegisterType)pHandler->GetWebinarNeedRegisterType(); + + if(registerType == WebinarNeedRegisterType::WebinarReg_By_Email_and_DisplayName) + return gcnew CIWebinarNeedRegisterHandlerByEmail(dynamic_cast(pHandler)); + else if(registerType == WebinarNeedRegisterType::WebinarReg_By_Register_Url) + return gcnew CIWebinarNeedRegisterHandlerByUrl(dynamic_cast(pHandler)); + } + + return nullptr; + } + private ref class CMeetingPasswordAndScreenNameHandler sealed : public IMeetingPasswordAndScreenNameHandler { public: @@ -78,6 +178,13 @@ namespace ZOOM_SDK_DOTNET_WRAP { CMeetingConfigurationDotNetWrap::Instance->ProcAirPlayInstructionWndNotification( bShow, WChar2PlatformString(airhostName)); } + + void onWebinarNeedRegisterNotification(ZOOM_SDK_NAMESPACE::IWebinarNeedRegisterHandler* pHandler) + { + if (CMeetingConfigurationDotNetWrap::Instance) + CMeetingConfigurationDotNetWrap::Instance->ProcWebinarNeedRegisterNotification( + TranslateWebinarNeedRegisterHandler(pHandler)); + } private: MeetingConfigurationEventHanlder() {} }; @@ -203,6 +310,11 @@ namespace ZOOM_SDK_DOTNET_WRAP { ZOOM_SDK_NAMESPACE::CSDKWrap::GetInst().GetMeetingServiceWrap().GetMeetingConfiguration().RedirectClickEndMeetingBTNEvent(bRedirect); } + void CMeetingConfigurationDotNetWrap::RedirectWebinarNeedRegister(bool bRedirect) + { + ZOOM_SDK_NAMESPACE::CSDKWrap::GetInst().GetMeetingServiceWrap().GetMeetingConfiguration().RedirectWebinarNeedRegister(bRedirect); + } + void CMeetingConfigurationDotNetWrap::EnableToolTipsShow(bool bEnable) { ZOOM_SDK_NAMESPACE::CSDKWrap::GetInst().GetMeetingServiceWrap().GetMeetingConfiguration().EnableToolTipsShow(bEnable); @@ -292,6 +404,10 @@ namespace ZOOM_SDK_DOTNET_WRAP { ZOOM_SDK_NAMESPACE::CSDKWrap::GetInst().GetMeetingServiceWrap().GetMeetingConfiguration().m_cbonAirPlayInstructionWndNotification = std::bind(&MeetingConfigurationEventHanlder::onAirPlayInstructionWndNotification, &MeetingConfigurationEventHanlder::GetInst(), std::placeholders::_1, std::placeholders::_2); + + ZOOM_SDK_NAMESPACE::CSDKWrap::GetInst().GetMeetingServiceWrap().GetMeetingConfiguration().m_cbonWebinarNeedRegisterNotification = + std::bind(&MeetingConfigurationEventHanlder::onWebinarNeedRegisterNotification, + &MeetingConfigurationEventHanlder::GetInst(), std::placeholders::_1); } void CMeetingConfigurationDotNetWrap::ProcInputMeetingPasswordAndScreenNameNotification(IMeetingPasswordAndScreenNameHandler^ pHandler) @@ -303,4 +419,9 @@ namespace ZOOM_SDK_DOTNET_WRAP { { event_onAirPlayInstructionWndNotification(bShow, airhostName); } + + void CMeetingConfigurationDotNetWrap::ProcWebinarNeedRegisterNotification(IWebinarNeedRegisterHandler^ pHandler) + { + event_onWebinarNeedRegisterNotification(pHandler); + } } \ No newline at end of file diff --git a/zoom_sdk_c_sharp_wrap/meeting_configuration_dotnet_wrap.h b/zoom_sdk_c_sharp_wrap/meeting_configuration_dotnet_wrap.h index 8dfed69..5f2a8d3 100644 --- a/zoom_sdk_c_sharp_wrap/meeting_configuration_dotnet_wrap.h +++ b/zoom_sdk_c_sharp_wrap/meeting_configuration_dotnet_wrap.h @@ -19,6 +19,33 @@ namespace ZOOM_SDK_DOTNET_WRAP { bool InputMeetingPasswordAndScreenName(String^ meetingPassword, String^ screenName); void Cancel(); }; + + public enum class WebinarNeedRegisterType : int + { + WebinarReg_NONE, ///Initialization + WebinarReg_By_Register_Url, ///Register webinar account by URL + WebinarReg_By_Email_and_DisplayName,///Register webinar account by email and the screen name. + }; + + public interface class IWebinarNeedRegisterHandler + { + public: + WebinarNeedRegisterType GetWebinarNeedRegisterType(); + }; + + public interface class IWebinarNeedRegisterHandlerByUrl : public IWebinarNeedRegisterHandler + { + public: + String^ GetWebinarRegisterUrl(); + void Release(); + }; + + public interface class IWebinarNeedRegisterHandlerByEmail : public IWebinarNeedRegisterHandler + { + public: + SDKError InputWebinarRegisterEmailAndScreenName(String^ email, String^ username); + void Cancel(); + }; /* //this one may be defined in another file. If so, remove this defination //just leave it here to make sure we have the class defined @@ -31,8 +58,10 @@ namespace ZOOM_SDK_DOTNET_WRAP { HWNDDotNet hParent; }; */ + public delegate void onWebinarNeedRegisterNotification(IWebinarNeedRegisterHandler^ pHandler); public delegate void onInputMeetingPasswordAndScreenNameNotification(IMeetingPasswordAndScreenNameHandler^ pHandler); public delegate void onAirPlayInstructionWndNotification(bool bShow, String^ airhostName); + public delegate void onWebinarNeedRegisterHandler(IWebinarNeedRegisterHandler^ pHandler); public interface class IMeetingConfigurationDotNetWrap { @@ -59,6 +88,7 @@ namespace ZOOM_SDK_DOTNET_WRAP { void PrePopulateWebinarRegistrationInfo(String^ email, String^ username); void RedirectClickShareBTNEvent(bool bRedirect); void RedirectClickEndMeetingBTNEvent(bool bRedirect); + void RedirectWebinarNeedRegister(bool bRedirect); void EnableToolTipsShow(bool bEnable); void EnableAirplayInstructionWindow(bool bEnable); void EnableClaimHostFeature(bool bEnable); @@ -78,6 +108,8 @@ namespace ZOOM_SDK_DOTNET_WRAP { void Add_CB_onAirPlayInstructionWndNotification(onAirPlayInstructionWndNotification^ cb); void Remove_CB_onInputMeetingPasswordAndScreenNameNotification(onInputMeetingPasswordAndScreenNameNotification^ cb); void Remove_CB_onAirPlayInstructionWndNotification(onAirPlayInstructionWndNotification^ cb); + void Add_CB_onWebinarNeedRegisterNotification(onWebinarNeedRegisterNotification^ cb); + void Remove_CB_onWebinarNeedRegisterNotification(onWebinarNeedRegisterNotification^ cb); }; private ref class CMeetingConfigurationDotNetWrap sealed : public IMeetingConfigurationDotNetWrap @@ -110,6 +142,7 @@ namespace ZOOM_SDK_DOTNET_WRAP { virtual void SetFloatVideoWndVisibility(bool bShow); virtual void PrePopulateWebinarRegistrationInfo(String^ email, String^ username); virtual void RedirectClickShareBTNEvent(bool bRedirect); + virtual void RedirectWebinarNeedRegister(bool bRedirect); virtual void RedirectClickEndMeetingBTNEvent(bool bRedirect); virtual void EnableToolTipsShow(bool bEnable); virtual void EnableAirplayInstructionWindow(bool bEnable); @@ -136,6 +169,16 @@ namespace ZOOM_SDK_DOTNET_WRAP { event_onInputMeetingPasswordAndScreenNameNotification -= cb; } + virtual void Add_CB_onWebinarNeedRegisterNotification(onWebinarNeedRegisterNotification^ cb) + { + event_onWebinarNeedRegisterNotification += cb; + } + + virtual void Remove_CB_onWebinarNeedRegisterNotification(onWebinarNeedRegisterNotification^ cb) + { + event_onWebinarNeedRegisterNotification -= cb; + } + virtual void Add_CB_onAirPlayInstructionWndNotification(onAirPlayInstructionWndNotification^ cb) { event_onAirPlayInstructionWndNotification += cb; @@ -149,11 +192,13 @@ namespace ZOOM_SDK_DOTNET_WRAP { void BindEvent(); void ProcInputMeetingPasswordAndScreenNameNotification(IMeetingPasswordAndScreenNameHandler^ pHandler); void ProcAirPlayInstructionWndNotification(bool bShow, String^ airhostName); + void ProcWebinarNeedRegisterNotification(IWebinarNeedRegisterHandler^ pHandler); private: CMeetingConfigurationDotNetWrap() {}; virtual ~CMeetingConfigurationDotNetWrap() {}; event onInputMeetingPasswordAndScreenNameNotification^ event_onInputMeetingPasswordAndScreenNameNotification; + event onWebinarNeedRegisterNotification^ event_onWebinarNeedRegisterNotification; event onAirPlayInstructionWndNotification^ event_onAirPlayInstructionWndNotification; static CMeetingConfigurationDotNetWrap^ m_Instance = gcnew CMeetingConfigurationDotNetWrap; };