mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 12:09:40 +00:00
Still having issues getting to compile - this is a WIP checking to help troubleshoot
This commit is contained in:
@@ -4,8 +4,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Stdafx.h"
|
||||
#include "include/cef_app.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_v8.h"
|
||||
|
||||
#include "JavascriptObjectWrapper.h"
|
||||
@@ -16,7 +14,7 @@ using namespace System::Runtime::Serialization;
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
public ref class JavascriptMethodWrapper
|
||||
private ref class JavascriptMethodWrapper
|
||||
{
|
||||
private:
|
||||
MCefRefPtr<JavascriptMethodHandler> _javascriptMethodHandler;
|
||||
@@ -37,9 +35,9 @@ namespace CefSharp
|
||||
virtual void Bind()
|
||||
{
|
||||
auto methodName = StringUtils::ToNative(_javascriptMethod->JavascriptName);
|
||||
auto v8Value = CefV8Value::CreateFunction(methodName, _javascriptMethodHandler.get());
|
||||
auto v8Function = CefV8Value::CreateFunction(methodName, _javascriptMethodHandler.get());
|
||||
|
||||
V8Value->SetValue(methodName, v8Value, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
V8Value->SetValue(methodName, v8Function, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
};
|
||||
|
||||
Object^ Execute(array<Object^>^ parameters);
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Stdafx.h"
|
||||
#include "include/cef_app.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_v8.h"
|
||||
|
||||
#include "JavascriptMethodWrapper.h"
|
||||
@@ -20,12 +18,12 @@ using namespace CefSharp::Internals;
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
public ref class JavascriptObjectWrapper
|
||||
private ref class JavascriptObjectWrapper
|
||||
{
|
||||
private:
|
||||
JavascriptObject^ _object;
|
||||
List<JavascriptMethodWrapper^>^ _wrappedMethods;
|
||||
List<JavascriptPropertyWrapper^>^ _wrappedProperties;
|
||||
//List<JavascriptMethodWrapper^>^ _wrappedMethods;
|
||||
//List<JavascriptPropertyWrapper^>^ _wrappedProperties;
|
||||
|
||||
internal:
|
||||
MCefRefPtr<CefV8Value> V8Value;
|
||||
@@ -35,29 +33,29 @@ namespace CefSharp
|
||||
{
|
||||
_object = object;
|
||||
|
||||
_wrappedMethods = gcnew List<JavascriptMethodWrapper^>();
|
||||
_wrappedProperties = gcnew List<JavascriptPropertyWrapper^>();
|
||||
//_wrappedMethods = gcnew List<JavascriptMethodWrapper^>();
|
||||
//_wrappedProperties = gcnew List<JavascriptPropertyWrapper^>();
|
||||
}
|
||||
|
||||
void Bind()
|
||||
{
|
||||
for each (JavascriptMethod^ method in Enumerable::OfType<JavascriptMethod^>(_object->Methods))
|
||||
{
|
||||
auto wrappedMethod = gcnew JavascriptMethodWrapper(method, _object->Id);
|
||||
wrappedMethod->V8Value = V8Value;
|
||||
wrappedMethod->Bind();
|
||||
//for each (JavascriptMethod^ method in Enumerable::OfType<JavascriptMethod^>(_object->Methods))
|
||||
//{
|
||||
// //auto wrappedMethod = gcnew JavascriptMethodWrapper(method, _object->Id);
|
||||
// //wrappedMethod->V8Value = V8Value;
|
||||
// //wrappedMethod->Bind();
|
||||
|
||||
_wrappedMethods->Add(wrappedMethod);
|
||||
}
|
||||
// //_wrappedMethods->Add(wrappedMethod);
|
||||
//}
|
||||
|
||||
for each (JavascriptProperty^ prop in Enumerable::OfType<JavascriptProperty^>(_object->Properties))
|
||||
{
|
||||
auto wrappedproperty = gcnew JavascriptPropertyWrapper(prop, _object->Id);
|
||||
wrappedproperty->V8Value = V8Value;
|
||||
wrappedproperty->Bind();
|
||||
//for each (JavascriptProperty^ prop in Enumerable::OfType<JavascriptProperty^>(_object->Properties))
|
||||
//{
|
||||
// //auto wrappedproperty = gcnew JavascriptPropertyWrapper(prop, _object->Id);
|
||||
// //wrappedproperty->V8Value = V8Value;
|
||||
// //wrappedproperty->Bind();
|
||||
|
||||
_wrappedProperties->Add(wrappedproperty);
|
||||
}
|
||||
// //_wrappedProperties->Add(wrappedproperty);
|
||||
//}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -5,8 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Stdafx.h"
|
||||
#include "include/cef_app.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_v8.h"
|
||||
|
||||
#include "JavascriptObjectWrapper.h"
|
||||
@@ -17,7 +15,7 @@ using namespace System::Runtime::Serialization;
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
public ref class JavascriptPropertyWrapper
|
||||
private ref class JavascriptPropertyWrapper
|
||||
{
|
||||
private:
|
||||
MCefRefPtr<JavascriptPropertyHandler> _javascriptPropertyHandler;
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "Stdafx.h"
|
||||
#include "include/cef_app.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_v8.h"
|
||||
|
||||
#include "JavascriptMethodWrapper.h"
|
||||
#include "JavascriptPropertyWrapper.h"
|
||||
#include "JavascriptObjectWrapper.h"
|
||||
|
||||
using namespace System::Runtime::Serialization;
|
||||
using namespace System::Linq;
|
||||
using namespace System::Collections::Generic;
|
||||
|
||||
@@ -40,7 +41,8 @@ namespace CefSharp
|
||||
for each (JavascriptObject^ obj in Enumerable::OfType<JavascriptObject^>(memberObjects))
|
||||
{
|
||||
auto wrapperObject = gcnew JavascriptObjectWrapper(obj);
|
||||
wrapperObject->V8Value = V8Value;
|
||||
//TODO: this needs to be set!
|
||||
//wrapperObject->V8Value = V8Value;
|
||||
wrapperObject->Bind();
|
||||
|
||||
_wrappedObjects->Add(wrapperObject);
|
||||
|
||||
Reference in New Issue
Block a user