Make wrapper objects contain references to the Properties/Methods they represent

This commit is contained in:
amaitland
2014-08-28 15:27:06 +10:00
parent d0dc5d9409
commit 0130fa427d
13 changed files with 102 additions and 128 deletions
@@ -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);
}
};
};
}