#include "stdafx.h" #pragma once using namespace System::Reflection; using namespace System::Collections::Generic; namespace CefSharp { class BindingData : public CefBase { protected: gcroot _obj; public: BindingData(Object^ obj) { _obj = obj; } Object^ Get() { return _obj; } IMPLEMENT_REFCOUNTING(BindingData); }; class BindingHandler : public CefV8Handler { // Type Converter static bool IsNullableType(Type^ type); static int GetChangeTypeCost(Object^ value, Type^ conversionType); static Object^ ChangeType(Object^ value, Type^ conversionType); CefRefPtr ConvertToCef(Object^ obj, Type^ type); Object^ ConvertFromCef(CefRefPtr obj); virtual bool Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception); public: static void Bind(String^ name, Object^ obj, CefRefPtr window); IMPLEMENT_REFCOUNTING(BindingHandler); }; }