mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 10:22:55 +00:00
34 lines
1.0 KiB
C++
34 lines
1.0 KiB
C++
// Copyright © 2010-2014 The CefSharp Project. All rights reserved.
|
|
//
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
|
#pragma once
|
|
|
|
#include "Stdafx.h"
|
|
|
|
#include "JavascriptPropertyWrapper.h"
|
|
#include "JavascriptObjectWrapper.h"
|
|
#include "CefAppWrapper.h"
|
|
|
|
using namespace System;
|
|
|
|
namespace CefSharp
|
|
{
|
|
void JavascriptPropertyWrapper::Bind()
|
|
{
|
|
auto propertyName = StringUtils::ToNative(_javascriptProperty->JavascriptName);
|
|
auto clrPropertyName = _javascriptProperty->JavascriptName;
|
|
|
|
if (_javascriptProperty->IsComplexType)
|
|
{
|
|
auto wrapperObject = gcnew JavascriptObjectWrapper(_javascriptProperty->Value);
|
|
wrapperObject->V8Value = V8Value.get();
|
|
wrapperObject->Bind();
|
|
}
|
|
else
|
|
{
|
|
auto propertyAttribute = _javascriptProperty->IsReadOnly ? V8_PROPERTY_ATTRIBUTE_READONLY : V8_PROPERTY_ATTRIBUTE_NONE;
|
|
|
|
V8Value->SetValue(propertyName, V8_ACCESS_CONTROL_DEFAULT, propertyAttribute);
|
|
}
|
|
};
|
|
} |