Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions zoom_sdk_c_sharp_wrap/meeting_configuration_dotnet_wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ZOOM_SDK_NAMESPACE::IWebinarNeedRegisterHandlerByEmail*>(pHandler));
else if(registerType == WebinarNeedRegisterType::WebinarReg_By_Register_Url)
return gcnew CIWebinarNeedRegisterHandlerByUrl(dynamic_cast<ZOOM_SDK_NAMESPACE::IWebinarNeedRegisterHandlerByUrl*>(pHandler));
}

return nullptr;
}

private ref class CMeetingPasswordAndScreenNameHandler sealed : public IMeetingPasswordAndScreenNameHandler
{
public:
Expand Down Expand Up @@ -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() {}
};
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand All @@ -303,4 +419,9 @@ namespace ZOOM_SDK_DOTNET_WRAP {
{
event_onAirPlayInstructionWndNotification(bShow, airhostName);
}

void CMeetingConfigurationDotNetWrap::ProcWebinarNeedRegisterNotification(IWebinarNeedRegisterHandler^ pHandler)
{
event_onWebinarNeedRegisterNotification(pHandler);
}
}
45 changes: 45 additions & 0 deletions zoom_sdk_c_sharp_wrap/meeting_configuration_dotnet_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
{
Expand All @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -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;
};
Expand Down