mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 03:32:37 +00:00
Make wrapper objects contain references to the Properties/Methods they represent
This commit is contained in:
@@ -7,9 +7,12 @@
|
||||
#include "Stdafx.h"
|
||||
#include "include/cef_app.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_v8.h"
|
||||
|
||||
#include "JavascriptObjectWrapper.h"
|
||||
|
||||
using namespace System::Runtime::Serialization;
|
||||
using namespace System::Linq;
|
||||
using namespace System::Collections::Generic;
|
||||
|
||||
using namespace CefSharp::Internals;
|
||||
|
||||
@@ -17,13 +20,31 @@ namespace CefSharp
|
||||
{
|
||||
public ref class JavascriptRootObjectWrapper
|
||||
{
|
||||
private:
|
||||
JavascriptRootObject^ _rootObject;
|
||||
List<JavascriptObjectWrapper^>^ _wrappedObjects;
|
||||
|
||||
internal:
|
||||
MCefRefPtr<CefV8Value> V8Value;
|
||||
public:
|
||||
|
||||
public:
|
||||
JavascriptRootObjectWrapper(JavascriptRootObject^ rootObject)
|
||||
{
|
||||
_rootObject = rootObject;
|
||||
_wrappedObjects = gcnew List<JavascriptObjectWrapper^>();
|
||||
}
|
||||
|
||||
void Bind()
|
||||
{
|
||||
|
||||
auto memberObjects = _rootObject->MemberObjects;
|
||||
for each (JavascriptObject^ obj in Enumerable::OfType<JavascriptObject^>(memberObjects))
|
||||
{
|
||||
auto wrapperObject = gcnew JavascriptObjectWrapper(obj);
|
||||
wrapperObject->V8Value = V8Value;
|
||||
wrapperObject->Bind();
|
||||
|
||||
_wrappedObjects->Add(wrapperObject);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user