mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 19:25:01 +00:00
Net Core - Support for compiling with .Net Core 3.1
- Make Wpf/WinForms/OffScreen projects target AnyCPU Only the VC++ projects are platform specific now. - Remove BrowserSubProcess project reference Not needed as we now have a standalone exe - Add OffScreen example - Add WPF Example project - Fix some compile errors for main solution - Add BrowserSubProcess executable - JavascriptObjectRepository remove isAsync param Rather than throw exception remove the option - BrowserSubprocess Exclude the WCF specific code from the netCore project - Add some ifdef/ifndef to exclude the WCF specific implementation - Move WCF implementation into separate namespace
This commit is contained in:
@@ -147,7 +147,11 @@ namespace CefSharp
|
||||
JavascriptRootObjectWrapper^ rootObject;
|
||||
if (!rootObjectWrappers->TryGetValue(frame->GetIdentifier(), rootObject))
|
||||
{
|
||||
#ifdef NETCOREAPP
|
||||
rootObject = gcnew JavascriptRootObjectWrapper(browser->GetIdentifier());
|
||||
#else
|
||||
rootObject = gcnew JavascriptRootObjectWrapper(browser->GetIdentifier(), _browserWrapper->BrowserProcess);
|
||||
#endif
|
||||
rootObjectWrappers->TryAdd(frame->GetIdentifier(), rootObject);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "Stdafx.h"
|
||||
|
||||
#include "SubProcess.h"
|
||||
#include "WcfEnabledSubProcess.h"
|
||||
|
||||
using namespace System;
|
||||
using namespace CefSharp::Internals;
|
||||
|
||||
@@ -292,7 +292,11 @@ namespace CefSharp
|
||||
JavascriptRootObjectWrapper^ rootObject;
|
||||
if (!rootObjectWrappers->TryGetValue(frameId, rootObject))
|
||||
{
|
||||
#ifdef NETCOREAPP
|
||||
rootObject = gcnew JavascriptRootObjectWrapper(browserId);
|
||||
#else
|
||||
rootObject = gcnew JavascriptRootObjectWrapper(browserId, browserWrapper->BrowserProcess);
|
||||
#endif
|
||||
rootObjectWrappers->TryAdd(frameId, rootObject);
|
||||
}
|
||||
|
||||
@@ -394,7 +398,11 @@ namespace CefSharp
|
||||
//as without javascript there is no need for a context.
|
||||
if (rootObjectWrapper == nullptr)
|
||||
{
|
||||
#ifdef NETCOREAPP
|
||||
rootObjectWrapper = gcnew JavascriptRootObjectWrapper(browser->GetIdentifier());
|
||||
#else
|
||||
rootObjectWrapper = gcnew JavascriptRootObjectWrapper(browser->GetIdentifier(), browserWrapper->BrowserProcess);
|
||||
#endif
|
||||
|
||||
browserWrapper->JavascriptRootObjectWrappers->TryAdd(frameId, rootObjectWrapper);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
#include "JavascriptRootObjectWrapper.h"
|
||||
|
||||
using namespace CefSharp::Internals::Async;
|
||||
#ifndef NETCOREAPP
|
||||
using namespace System::ServiceModel;
|
||||
#endif
|
||||
using namespace System::Threading;
|
||||
using namespace System::Threading::Tasks;
|
||||
|
||||
@@ -65,9 +67,8 @@ namespace CefSharp
|
||||
#ifndef NETCOREAPP
|
||||
// This allows us to create the WCF proxies back to our parent process.
|
||||
property ChannelFactory<IBrowserProcess^>^ ChannelFactory;
|
||||
#endif
|
||||
|
||||
// The WCF proxy to the parent process.
|
||||
property IBrowserProcess^ BrowserProcess;
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
@@ -169,6 +169,7 @@
|
||||
<ClInclude Include="..\CefSharp.Core\Internals\StringUtils.h" />
|
||||
<ClInclude Include="BindObjectAsyncHandler.h" />
|
||||
<ClCompile Include="BrowserSubprocessExecutable.h" />
|
||||
<ClInclude Include="JavascriptRootObjectWrapper.h" />
|
||||
<ClInclude Include="SubProcessApp.h" />
|
||||
<ClInclude Include="Async\JavascriptAsyncMethodCallback.h" />
|
||||
<ClInclude Include="Async\JavascriptAsyncMethodHandler.h" />
|
||||
@@ -176,24 +177,16 @@
|
||||
<ClInclude Include="Async\JavascriptAsyncObjectWrapper.h" />
|
||||
<ClInclude Include="CefAppUnmanagedWrapper.h" />
|
||||
<ClInclude Include="JavascriptPostMessageHandler.h" />
|
||||
<ClCompile Include="WcfBrowserSubprocessExecutable.h" />
|
||||
<ClInclude Include="Wrapper\Frame.h" />
|
||||
<ClInclude Include="Wrapper\Browser.h" />
|
||||
<ClInclude Include="Wrapper\V8Context.h" />
|
||||
<ClInclude Include="RegisterBoundObjectHandler.h" />
|
||||
<ClInclude Include="RegisterBoundObjectRegistry.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="WcfEnabledSubProcess.h" />
|
||||
<ClInclude Include="SubProcess.h" />
|
||||
<ClInclude Include="CefBrowserWrapper.h" />
|
||||
<ClInclude Include="JavascriptCallbackRegistry.h" />
|
||||
<ClInclude Include="JavascriptCallbackWrapper.h" />
|
||||
<ClInclude Include="JavascriptMethodWrapper.h" />
|
||||
<ClInclude Include="JavascriptMethodHandler.h" />
|
||||
<ClInclude Include="JavascriptObjectWrapper.h" />
|
||||
<ClInclude Include="JavascriptPropertyWrapper.h" />
|
||||
<ClInclude Include="JavascriptPropertyHandler.h" />
|
||||
<ClInclude Include="JavascriptRootObjectWrapper.h" />
|
||||
<ClInclude Include="Serialization\JsObjectsSerialization.h" />
|
||||
<ClInclude Include="Stdafx.h" />
|
||||
<ClInclude Include="TypeUtils.h" />
|
||||
@@ -209,15 +202,10 @@
|
||||
<ClCompile Include="Async\JavascriptAsyncMethodWrapper.cpp" />
|
||||
<ClCompile Include="Async\JavascriptAsyncObjectWrapper.cpp" />
|
||||
<ClCompile Include="CefAppUnmanagedWrapper.cpp" />
|
||||
<ClCompile Include="JavascriptRootObjectWrapper.cpp" />
|
||||
<ClCompile Include="Wrapper\Frame.cpp" />
|
||||
<ClCompile Include="Wrapper\Browser.cpp" />
|
||||
<ClCompile Include="WcfEnabledSubProcess.cpp" />
|
||||
<ClCompile Include="JavascriptCallbackRegistry.cpp" />
|
||||
<ClCompile Include="JavascriptMethodHandler.cpp" />
|
||||
<ClCompile Include="JavascriptMethodWrapper.cpp" />
|
||||
<ClCompile Include="JavascriptObjectWrapper.cpp" />
|
||||
<ClCompile Include="JavascriptPropertyWrapper.cpp" />
|
||||
<ClCompile Include="JavascriptRootObjectWrapper.cpp" />
|
||||
<ClCompile Include="Serialization\JsObjectsSerialization.cpp" />
|
||||
<ClCompile Include="Stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "include/cef_v8.h"
|
||||
#include "JavascriptCallbackRegistry.h"
|
||||
|
||||
using namespace CefSharp::Internals::Wcf;
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
private class JavascriptMethodHandler : public CefV8Handler
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "JavascriptMethodHandler.h"
|
||||
|
||||
using namespace System::Runtime::Serialization;
|
||||
using namespace CefSharp::Internals::Wcf;
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
@@ -44,4 +45,4 @@ namespace CefSharp
|
||||
void Bind(JavascriptMethod^ javascriptMethod, const CefRefPtr<CefV8Value>& v8Value);
|
||||
BrowserProcessResponse^ Execute(array<Object^>^ parameters);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "include/cef_v8.h"
|
||||
#include "JavascriptCallbackRegistry.h"
|
||||
|
||||
using namespace CefSharp::Internals::Wcf;
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
private ref class JavascriptPropertyWrapper
|
||||
@@ -37,4 +39,4 @@ namespace CefSharp
|
||||
|
||||
void Bind(JavascriptProperty^ javascriptProperty, const CefRefPtr<CefV8Value>& v8Value, JavascriptCallbackRegistry^ callbackRegistry);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace CefSharp
|
||||
|
||||
_wrappedAsyncObjects->Add(wrapperObject);
|
||||
}
|
||||
#ifndef NETCOREAPP
|
||||
else
|
||||
{
|
||||
if (_browserProcess == nullptr)
|
||||
@@ -41,6 +42,7 @@ namespace CefSharp
|
||||
|
||||
_wrappedObjects->Add(wrapperObject);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,4 +68,4 @@ namespace CefSharp
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
|
||||
#include "include/cef_v8.h"
|
||||
#include "JavascriptCallbackRegistry.h"
|
||||
#ifndef NETCOREAPP
|
||||
#include "JavascriptObjectWrapper.h"
|
||||
#endif
|
||||
#include "Async/JavascriptAsyncObjectWrapper.h"
|
||||
|
||||
using namespace System::Runtime::Serialization;
|
||||
@@ -14,6 +16,9 @@ using namespace System::Linq;
|
||||
using namespace System::Collections::Generic;
|
||||
|
||||
using namespace CefSharp::Internals::Async;
|
||||
#ifndef NETCOREAPP
|
||||
using namespace CefSharp::Internals::Wcf;
|
||||
#endif
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
@@ -28,10 +33,14 @@ namespace CefSharp
|
||||
//Is static so ids are unique to this process https://github.com/cefsharp/CefSharp/issues/2792
|
||||
static int64 _lastCallback;
|
||||
|
||||
#ifndef NETCOREAPP
|
||||
initonly List<JavascriptObjectWrapper^>^ _wrappedObjects;
|
||||
#endif
|
||||
initonly List<JavascriptAsyncObjectWrapper^>^ _wrappedAsyncObjects;
|
||||
initonly Dictionary<int64, JavascriptAsyncMethodCallback^>^ _methodCallbacks;
|
||||
#ifndef NETCOREAPP
|
||||
IBrowserProcess^ _browserProcess;
|
||||
#endif
|
||||
// The entire set of possible JavaScript functions to
|
||||
// call directly into.
|
||||
JavascriptCallbackRegistry^ _callbackRegistry;
|
||||
@@ -45,10 +54,16 @@ namespace CefSharp
|
||||
}
|
||||
|
||||
public:
|
||||
#ifdef NETCOREAPP
|
||||
JavascriptRootObjectWrapper(int browserId)
|
||||
#else
|
||||
JavascriptRootObjectWrapper(int browserId, IBrowserProcess^ browserProcess)
|
||||
#endif
|
||||
{
|
||||
#ifndef NETCOREAPP
|
||||
_browserProcess = browserProcess;
|
||||
_wrappedObjects = gcnew List<JavascriptObjectWrapper^>();
|
||||
#endif
|
||||
_wrappedAsyncObjects = gcnew List<JavascriptAsyncObjectWrapper^>();
|
||||
_callbackRegistry = gcnew JavascriptCallbackRegistry(browserId);
|
||||
_methodCallbacks = gcnew Dictionary<int64, JavascriptAsyncMethodCallback^>();
|
||||
@@ -62,12 +77,15 @@ namespace CefSharp
|
||||
_callbackRegistry = nullptr;
|
||||
}
|
||||
|
||||
#ifndef NETCOREAPP
|
||||
for each (JavascriptObjectWrapper^ var in _wrappedObjects)
|
||||
{
|
||||
delete var;
|
||||
}
|
||||
_wrappedObjects->Clear();
|
||||
|
||||
#endif
|
||||
|
||||
for each (JavascriptAsyncObjectWrapper^ var in _wrappedAsyncObjects)
|
||||
{
|
||||
delete var;
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "WcfEnabledSubProcess.h"
|
||||
#include "BrowserSubprocessExecutable.h"
|
||||
|
||||
#ifndef NETCOREAPP
|
||||
using namespace System;
|
||||
using namespace CefSharp::Internals;
|
||||
|
||||
@@ -45,4 +44,3 @@ namespace CefSharp
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "Stdafx.h"
|
||||
#include "WcfEnabledSubProcess.h"
|
||||
|
||||
#ifndef NETCOREAPP
|
||||
using namespace System::ServiceModel;
|
||||
|
||||
namespace CefSharp
|
||||
@@ -102,4 +101,3 @@ namespace CefSharp
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
#ifndef NETCOREAPP
|
||||
#pragma once
|
||||
|
||||
#include "Stdafx.h"
|
||||
@@ -37,4 +36,3 @@ namespace CefSharp
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<!-- Note: We cannot use the recommended style of specifying <Project Sdk=...> because we need
|
||||
to set BaseIntermediateOutputPath and BaseOutputPath before the SDK props are imported. -->
|
||||
<PropertyGroup>
|
||||
<BaseIntermediateOutputPath>obj.netcore\</BaseIntermediateOutputPath>
|
||||
<BaseOutputPath>bin.netcore\</BaseOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Implicit top import -->
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RootNamespace>CefSharp.BrowserSubprocess</RootNamespace>
|
||||
<AssemblyName>CefSharp.BrowserSubprocess</AssemblyName>
|
||||
<DocumentationFile>$(BaseOutputPath)$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>..\CefSharp.snk</AssemblyOriginatorKeyFile>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<StartupObject>CefSharp.BrowserSubprocess.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<WarningLevel>2</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="bin\**" />
|
||||
<Compile Remove="obj\**" />
|
||||
<EmbeddedResource Remove="bin\**" />
|
||||
<EmbeddedResource Remove="obj\**" />
|
||||
<None Remove="bin\**" />
|
||||
<None Remove="obj\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="Program.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CefSharp.BrowserSubprocess.Core\CefSharp.BrowserSubprocess.Core.netcore.vcxproj" />
|
||||
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Implicit bottom import -->
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
|
||||
</Project>
|
||||
@@ -0,0 +1,37 @@
|
||||
// Copyright © 2020 The CefSharp Authors. All rights reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
using System.Diagnostics;
|
||||
using CefSharp.RenderProcess;
|
||||
|
||||
namespace CefSharp.BrowserSubprocess
|
||||
{
|
||||
/// <summary>
|
||||
/// When implementing your own BrowserSubprocess
|
||||
/// - For .Net Core use <see cref="BrowserSubprocessExecutable"/> (No WCF Support)
|
||||
/// - Include an app.manifest with the dpi/compatability sections, this is required (this project contains the relevant).
|
||||
/// - If you are targeting x86/Win32 then you should set /LargeAddressAware (https://docs.microsoft.com/en-us/cpp/build/reference/largeaddressaware?view=vs-2017)
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
Debug.WriteLine("BrowserSubprocess starting up with command line: " + string.Join("\n", args));
|
||||
|
||||
SubProcess.EnableHighDPISupport();
|
||||
|
||||
//Add your own custom implementation of IRenderProcessHandler here
|
||||
IRenderProcessHandler handler = null;
|
||||
|
||||
//The BrowserSubprocessExecutable provides BrowserSubProcess functionality
|
||||
//specific to CefSharp there is no WCF support used for the sync JSB feature.
|
||||
var browserProcessExe = new BrowserSubprocessExecutable();
|
||||
var result = browserProcessExe.Main(args, handler);
|
||||
|
||||
Debug.WriteLine("BrowserSubprocess shutting down.");
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"profiles": {
|
||||
"CefSharp.BrowserSubprocess.netcore": {
|
||||
"commandName": "Project",
|
||||
"nativeDebugging": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
using namespace System::Diagnostics;
|
||||
#ifndef NETCOREAPP
|
||||
using namespace System::ServiceModel;
|
||||
using namespace CefSharp::Internals::Wcf;
|
||||
#endif
|
||||
using namespace System::Threading;
|
||||
using namespace System::Threading::Tasks;
|
||||
|
||||
@@ -159,18 +159,16 @@ namespace CefSharp.Example
|
||||
|
||||
//settings.LogSeverity = LogSeverity.Verbose;
|
||||
|
||||
#if !NETCOREAPP
|
||||
if (DebuggingSubProcess)
|
||||
{
|
||||
|
||||
#if NETCOREAPP
|
||||
settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin.netcore\\Debug\\netcoreapp3.1\\CefSharp.BrowserSubprocess.exe");
|
||||
#else
|
||||
var architecture = Environment.Is64BitProcess ? "x64" : "x86";
|
||||
settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin\\" + architecture + "\\Debug\\CefSharp.BrowserSubprocess.exe");
|
||||
}
|
||||
#else
|
||||
// We use our Applications exe as the BrowserSubProcess, multiple copies
|
||||
// will be spawned.
|
||||
var exePath = Process.GetCurrentProcess().MainModule.FileName;
|
||||
settings.BrowserSubprocessPath = exePath;
|
||||
#endif
|
||||
}
|
||||
|
||||
settings.RegisterScheme(new CefCustomScheme
|
||||
{
|
||||
@@ -241,14 +239,7 @@ namespace CefSharp.Example
|
||||
//see https://github.com/cefsharp/CefSharp/wiki/General-Usage#proxy-resolution
|
||||
//CefSharpSettings.Proxy = new ProxyOptions(ip: "127.0.0.1", port: "8080", username: "cefsharp", password: "123");
|
||||
|
||||
bool performDependencyCheck =
|
||||
#if !NETCOREAPP
|
||||
!DebuggingSubProcess;
|
||||
#else
|
||||
// For .NET Core, don't perform a dependency check, to allow publishing single-file
|
||||
// executables.
|
||||
false;
|
||||
#endif
|
||||
bool performDependencyCheck = !DebuggingSubProcess;
|
||||
|
||||
if (!Cef.Initialize(settings, performDependencyCheck: performDependencyCheck, browserProcessHandler: browserProcessHandler))
|
||||
{
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Platforms>x86;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<!-- Note: We cannot use the recommended style of specifying <Project Sdk=...> because we need
|
||||
to set BaseIntermediateOutputPath and BaseOutputPath before the SDK props are imported. -->
|
||||
<PropertyGroup>
|
||||
<BaseIntermediateOutputPath>obj.netcore\</BaseIntermediateOutputPath>
|
||||
<BaseOutputPath>bin.netcore\</BaseOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RootNamespace>CefSharp.OffScreen.Example</RootNamespace>
|
||||
<AssemblyName>CefSharp.OffScreen.Example</AssemblyName>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Platforms>x86;x64</Platforms>
|
||||
<StartupObject>CefSharp.OffScreen.Example.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.vcxproj" />
|
||||
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
|
||||
<ProjectReference Include="..\CefSharp.OffScreen\CefSharp.OffScreen.netcore.csproj" />
|
||||
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="crash_reporter.cfg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Don't include items from the "bin" and "obj" folders used by the .NET Framework projects. -->
|
||||
<None Remove="bin/**/*.*" />
|
||||
<None Remove="obj/**/*.*" />
|
||||
<Compile Remove="obj/**/*.*" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
|
||||
</Project>
|
||||
@@ -167,10 +167,14 @@ namespace CefSharp.OffScreen.Example
|
||||
// Dispose it to avoid keeping the memory alive. Especially important in 32-bit applications.
|
||||
bitmap.Dispose();
|
||||
|
||||
Console.WriteLine("Screenshot saved. Launching your default image viewer...");
|
||||
Console.WriteLine("Screenshot saved. Launching your default image viewer...");
|
||||
|
||||
// Tell Windows to launch the saved image.
|
||||
Process.Start(screenshotPath);
|
||||
Process.Start(new ProcessStartInfo(screenshotPath)
|
||||
{
|
||||
// UseShellExecute is false by default on .NET Core.
|
||||
UseShellExecute = true
|
||||
});
|
||||
|
||||
Console.WriteLine("Image viewer launched. Press any key to exit.");
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>..\CefSharp.snk</AssemblyOriginatorKeyFile>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Platforms>x86;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -65,10 +65,12 @@ namespace CefSharp.WinForms.Example
|
||||
browser.IsBrowserInitializedChanged += OnIsBrowserInitializedChanged;
|
||||
browser.LoadError += OnLoadError;
|
||||
|
||||
#if !NETCOREAPP
|
||||
#if NETCOREAPP
|
||||
browser.JavascriptObjectRepository.Register("boundAsync", new AsyncBoundObject(), options: BindingOptions.DefaultBinder);
|
||||
#else
|
||||
browser.JavascriptObjectRepository.Register("bound", new BoundObject(), isAsync: false, options: BindingOptions.DefaultBinder);
|
||||
#endif
|
||||
browser.JavascriptObjectRepository.Register("boundAsync", new AsyncBoundObject(), isAsync: true, options: BindingOptions.DefaultBinder);
|
||||
#endif
|
||||
|
||||
//If you call CefSharp.BindObjectAsync in javascript and pass in the name of an object which is not yet
|
||||
//bound, then ResolveObject will be called, you can then register it
|
||||
@@ -77,7 +79,11 @@ namespace CefSharp.WinForms.Example
|
||||
var repo = e.ObjectRepository;
|
||||
if (e.ObjectName == "boundAsync2")
|
||||
{
|
||||
#if NETCOREAPP
|
||||
repo.Register("boundAsync2", new AsyncBoundObject(), options: BindingOptions.DefaultBinder);
|
||||
#else
|
||||
repo.Register("boundAsync2", new AsyncBoundObject(), isAsync: true, options: BindingOptions.DefaultBinder);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<!-- Note: We cannot use the recommended style of specifying <Project Sdk=...> because we need
|
||||
<!-- Note: We cannot use the recommended style of specifying <Project Sdk=...> because we need
|
||||
to set BaseIntermediateOutputPath and BaseOutputPath before the SDK props are imported. -->
|
||||
<PropertyGroup>
|
||||
<BaseIntermediateOutputPath>obj.netcore\</BaseIntermediateOutputPath>
|
||||
<BaseOutputPath>bin.netcore\</BaseOutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<BaseIntermediateOutputPath>obj.netcore\</BaseIntermediateOutputPath>
|
||||
<BaseOutputPath>bin.netcore\</BaseOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RootNamespace>CefSharp.WinForms.Example</RootNamespace>
|
||||
<AssemblyName>CefSharp.WinForms.Example</AssemblyName>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Platforms>x86;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RootNamespace>CefSharp.WinForms.Example</RootNamespace>
|
||||
<AssemblyName>CefSharp.WinForms.Example</AssemblyName>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Platforms>x86;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CefSharp.BrowserSubprocess.Core\CefSharp.BrowserSubprocess.Core.netcore.vcxproj" />
|
||||
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.vcxproj" />
|
||||
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
|
||||
<ProjectReference Include="..\CefSharp.WinForms\CefSharp.WinForms.netcore.csproj" />
|
||||
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.vcxproj" />
|
||||
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
|
||||
<ProjectReference Include="..\CefSharp.WinForms\CefSharp.WinForms.netcore.csproj" />
|
||||
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="crash_reporter.cfg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Don't include items from the "bin" and "obj" folders used by the .NET Framework projects. -->
|
||||
<None Remove="bin/**/*.*" />
|
||||
<None Remove="obj/**/*.*" />
|
||||
<Compile Remove="obj/**/*.*" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="crash_reporter.cfg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Don't include items from the "bin" and "obj" folders used by the .NET Framework projects. -->
|
||||
<None Remove="bin/**/*.*" />
|
||||
<None Remove="obj/**/*.*" />
|
||||
<Compile Remove="obj/**/*.*" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
|
||||
</Project>
|
||||
@@ -50,18 +50,6 @@ namespace CefSharp.WinForms.Example
|
||||
}
|
||||
else
|
||||
{
|
||||
#if NETCOREAPP
|
||||
//We are using our current exe as the BrowserSubProcess
|
||||
//Multiple instances will be spawned to handle all the
|
||||
//Chromium proceses, render, gpu, network, plugin, etc.
|
||||
var subProcessExe = new CefSharp.BrowserSubprocess.BrowserSubprocessExecutable();
|
||||
var result = subProcessExe.Main(args);
|
||||
if (result > 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
if (!System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>..\CefSharp.snk</AssemblyOriginatorKeyFile>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Platforms>x86;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<!-- Note: We cannot use the recommended style of specifying <Project Sdk=...> because we need
|
||||
to set BaseIntermediateOutputPath and BaseOutputPath before the SDK props are imported. -->
|
||||
<PropertyGroup>
|
||||
<BaseIntermediateOutputPath>obj.netcore\</BaseIntermediateOutputPath>
|
||||
<BaseOutputPath>bin.netcore\</BaseOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RootNamespace>CefSharp.Wpf.Example</RootNamespace>
|
||||
<AssemblyName>CefSharp.Wpf.Example</AssemblyName>
|
||||
<UseWPF>true</UseWPF>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Platforms>x86;x64</Platforms>
|
||||
<StartupObject>CefSharp.Wpf.Example.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.vcxproj" />
|
||||
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
|
||||
<ProjectReference Include="..\CefSharp.Wpf\CefSharp.Wpf.netcore.csproj" />
|
||||
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
|
||||
<PackageReference Include="MvvmLightLibs" Version="5.4.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="crash_reporter.cfg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Don't include items from the "bin" and "obj" folders used by the .NET Framework projects. -->
|
||||
<None Remove="bin/**/*.*" />
|
||||
<None Remove="obj/**/*.*" />
|
||||
<Compile Remove="obj/**/*.*" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
|
||||
</Project>
|
||||
@@ -19,8 +19,13 @@ namespace CefSharp.Wpf.Example
|
||||
boundObjectOne = new JavascriptCallbackBoundObject(BrowserOne);
|
||||
boundObjectTwo = new JavascriptCallbackBoundObject(BrowserTwo);
|
||||
|
||||
#if NETCOREAPP
|
||||
BrowserOne.JavascriptObjectRepository.Register("boundObject", boundObjectOne);
|
||||
BrowserTwo.JavascriptObjectRepository.Register("boundObject", boundObjectTwo);
|
||||
#else
|
||||
BrowserOne.JavascriptObjectRepository.Register("boundObject", boundObjectOne, false);
|
||||
BrowserTwo.JavascriptObjectRepository.Register("boundObject", boundObjectTwo, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
private void ExecuteCallbackImmediatelyClick(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -50,7 +50,9 @@ namespace CefSharp.Wpf.Example.Views
|
||||
|
||||
//To use the ResolveObject below and bind an object with isAsync:false we must set CefSharpSettings.WcfEnabled = true before
|
||||
//the browser is initialized.
|
||||
#if !NETCOREAPP
|
||||
CefSharpSettings.WcfEnabled = true;
|
||||
#endif
|
||||
|
||||
//If you call CefSharp.BindObjectAsync in javascript and pass in the name of an object which is not yet
|
||||
//bound, then ResolveObject will be called, you can then register it
|
||||
@@ -61,6 +63,23 @@ namespace CefSharp.Wpf.Example.Views
|
||||
//When JavascriptObjectRepository.Settings.LegacyBindingEnabled = true
|
||||
//This event will be raised with ObjectName == Legacy so you can bind your
|
||||
//legacy objects
|
||||
#if NETCOREAPP
|
||||
if (e.ObjectName == "Legacy")
|
||||
{
|
||||
repo.Register("boundAsync", new AsyncBoundObject(), options: bindingOptions);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.ObjectName == "boundAsync")
|
||||
{
|
||||
repo.Register("boundAsync", new AsyncBoundObject(), options: bindingOptions);
|
||||
}
|
||||
else if (e.ObjectName == "boundAsync2")
|
||||
{
|
||||
repo.Register("boundAsync2", new AsyncBoundObject(), options: bindingOptions);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (e.ObjectName == "Legacy")
|
||||
{
|
||||
repo.Register("bound", new BoundObject(), isAsync: false, options: BindingOptions.DefaultBinder);
|
||||
@@ -81,6 +100,7 @@ namespace CefSharp.Wpf.Example.Views
|
||||
repo.Register("boundAsync2", new AsyncBoundObject(), isAsync: true, options: bindingOptions);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
browser.JavascriptObjectRepository.ObjectBoundInJavascript += (sender, e) =>
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>..\CefSharp.snk</AssemblyOriginatorKeyFile>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Platforms>x86;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -283,8 +283,8 @@
|
||||
<Compile Include="Internals\IJavascriptCallbackFactory.cs" />
|
||||
<Compile Include="Internals\IntPtrExtensions.cs" />
|
||||
<Compile Include="Internals\JavascriptCallback.cs" />
|
||||
<Compile Include="Internals\JavascriptCallbackEndpointBehavior.cs" />
|
||||
<Compile Include="Internals\JavascriptCallbackSurrogate.cs" />
|
||||
<Compile Include="Internals\Wcf\JavascriptCallbackEndpointBehavior.cs" />
|
||||
<Compile Include="Internals\Wcf\JavascriptCallbackSurrogate.cs" />
|
||||
<Compile Include="Internals\PendingTaskRepository.cs" />
|
||||
<Compile Include="Internals\ReflectionUtils.cs" />
|
||||
<Compile Include="IResponse.cs" />
|
||||
@@ -292,15 +292,15 @@
|
||||
<Compile Include="Structs\MouseEvent.cs" />
|
||||
<Compile Include="IDragData.cs" />
|
||||
<Compile Include="DownloadItem.cs" />
|
||||
<Compile Include="Internals\BrowserProcessResponse.cs" />
|
||||
<Compile Include="Internals\Wcf\BrowserProcessResponse.cs" />
|
||||
<Compile Include="Internals\TaskExtensions.cs" />
|
||||
<Compile Include="IContextMenuParams.cs" />
|
||||
<Compile Include="Internals\ITaskScheduler.cs" />
|
||||
<Compile Include="JavascriptIgnoreAttribute.cs" />
|
||||
<Compile Include="JavascriptResponse.cs" />
|
||||
<Compile Include="Internals\BrowserProcessService.cs" />
|
||||
<Compile Include="Internals\BrowserProcessServiceHost.cs" />
|
||||
<Compile Include="Internals\WCFExtensions.cs" />
|
||||
<Compile Include="Internals\Wcf\BrowserProcessService.cs" />
|
||||
<Compile Include="Internals\Wcf\BrowserProcessServiceHost.cs" />
|
||||
<Compile Include="Internals\Wcf\WcfExtensions.cs" />
|
||||
<Compile Include="PostDataExtensions.cs" />
|
||||
<Compile Include="Structs\Range.cs" />
|
||||
<Compile Include="Structs\Rect.cs" />
|
||||
@@ -310,7 +310,7 @@
|
||||
<Compile Include="SchemeHandler\FolderSchemeHandlerFactory.cs" />
|
||||
<Compile Include="SchemeHandler\ISchemeHandlerFactory.cs" />
|
||||
<Compile Include="SslStatus.cs" />
|
||||
<Compile Include="Internals\IBrowserProcess.cs" />
|
||||
<Compile Include="Internals\Wcf\IBrowserProcess.cs" />
|
||||
<Compile Include="Internals\JavascriptMethod.cs" />
|
||||
<Compile Include="Internals\JavascriptObject.cs" />
|
||||
<Compile Include="Internals\JavascriptObjectRepository.cs" />
|
||||
|
||||
@@ -22,8 +22,11 @@
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Don't include items from the "bin" and "obj" folders used by the .NET Framework projects. -->
|
||||
<EmbeddedResource Remove="Internals\Wcf\**" />
|
||||
<None Remove="bin/**/*.*" />
|
||||
<None Remove="Internals\Wcf\**" />
|
||||
<None Remove="obj/**/*.*" />
|
||||
<Compile Remove="Internals\Wcf\**" />
|
||||
<Compile Remove="obj/**/*.*" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace CefSharp
|
||||
/// </summary>
|
||||
/// <param name="name">object name</param>
|
||||
/// <param name="objectToBind">the object that will be bound in javascript</param>
|
||||
#if !NETCOREAPP
|
||||
/// <param name="isAsync">
|
||||
/// if true the object will be registered for async communication,
|
||||
/// only methods will be exposed and when called from javascript will return a Promise to be awaited.
|
||||
@@ -37,9 +38,14 @@ namespace CefSharp
|
||||
/// If false then methods and properties will be registered, this method relies on a WCF service to communicate.
|
||||
/// If you are targeting .Net Core then you can only use isAsync = true as Microsoft has chosen not to support WCF.
|
||||
/// </param>
|
||||
#endif
|
||||
/// <param name="options">binding options, by default method/property names are camelCased, you can control this
|
||||
/// and other advanced options though this class.</param>
|
||||
#if NETCOREAPP
|
||||
void Register(string name, object objectToBind, BindingOptions options = null);
|
||||
#else
|
||||
void Register(string name, object objectToBind, bool isAsync, BindingOptions options = null);
|
||||
#endif
|
||||
/// <summary>
|
||||
/// UnRegister all the currently bound objects from the repository. If you unregister an object that is currently
|
||||
/// bound in JavaScript then the method/property calls will fail.
|
||||
|
||||
@@ -153,7 +153,11 @@ namespace CefSharp.Internals
|
||||
return result;
|
||||
}
|
||||
|
||||
#if NETCOREAPP
|
||||
public void Register(string name, object value, BindingOptions options)
|
||||
#else
|
||||
public void Register(string name, object value, bool isAsync, BindingOptions options)
|
||||
#endif
|
||||
{
|
||||
if (name == null)
|
||||
{
|
||||
@@ -165,9 +169,12 @@ namespace CefSharp.Internals
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
|
||||
//Enable WCF if not already enabled - can only be done before the browser has been initliazed
|
||||
//if done after the subprocess won't be WCF enabled it we'll have to throw an exception
|
||||
#if NETCOREAPP
|
||||
var isAsync = true;
|
||||
#else
|
||||
if (!IsBrowserInitialized && !isAsync)
|
||||
{
|
||||
CefSharpSettings.WcfEnabled = true;
|
||||
@@ -177,13 +184,7 @@ namespace CefSharp.Internals
|
||||
{
|
||||
throw new InvalidOperationException(@"To enable synchronous JS bindings set WcfEnabled true in CefSharpSettings before you create
|
||||
your ChromiumWebBrowser instances.");
|
||||
}
|
||||
#else
|
||||
// WCF is not available on .NET Core.
|
||||
if (!isAsync)
|
||||
{
|
||||
throw new NotSupportedException("Synchronous JS bindings are not supported.");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//Validation name is unique
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace CefSharp.Internals
|
||||
namespace CefSharp.Internals.Wcf
|
||||
{
|
||||
[DataContract]
|
||||
[KnownType(typeof(bool[]))]
|
||||
+1
-3
@@ -2,10 +2,9 @@
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
#if !NETCOREAPP
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace CefSharp.Internals
|
||||
namespace CefSharp.Internals.Wcf
|
||||
{
|
||||
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple)]
|
||||
internal class BrowserProcessService : IBrowserProcess
|
||||
@@ -49,4 +48,3 @@ namespace CefSharp.Internals
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+1
-3
@@ -2,14 +2,13 @@
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
#if !NETCOREAPP
|
||||
using System;
|
||||
using System.Net.Security;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.ServiceModel.Description;
|
||||
|
||||
namespace CefSharp.Internals
|
||||
namespace CefSharp.Internals.Wcf
|
||||
{
|
||||
public class BrowserProcessServiceHost : ServiceHost
|
||||
{
|
||||
@@ -68,4 +67,3 @@ namespace CefSharp.Internals
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -3,13 +3,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
using System.Collections.Generic;
|
||||
#if !NETCOREAPP
|
||||
using System.ServiceModel;
|
||||
#endif
|
||||
|
||||
namespace CefSharp.Internals
|
||||
namespace CefSharp.Internals.Wcf
|
||||
{
|
||||
#if !NETCOREAPP
|
||||
[ServiceContract(SessionMode = SessionMode.Required)]
|
||||
[ServiceKnownType(typeof(object[]))]
|
||||
[ServiceKnownType(typeof(Dictionary<string, object>))]
|
||||
@@ -17,22 +14,16 @@ namespace CefSharp.Internals
|
||||
[ServiceKnownType(typeof(JavascriptMethod))]
|
||||
[ServiceKnownType(typeof(JavascriptProperty))]
|
||||
[ServiceKnownType(typeof(JavascriptCallback))]
|
||||
#endif
|
||||
|
||||
public interface IBrowserProcess
|
||||
{
|
||||
#if !NETCOREAPP
|
||||
[OperationContract]
|
||||
#endif
|
||||
BrowserProcessResponse CallMethod(long objectId, string name, object[] parameters);
|
||||
|
||||
#if !NETCOREAPP
|
||||
[OperationContract]
|
||||
#endif
|
||||
BrowserProcessResponse GetProperty(long objectId, string name);
|
||||
|
||||
#if !NETCOREAPP
|
||||
[OperationContract]
|
||||
#endif
|
||||
BrowserProcessResponse SetProperty(long objectId, string name, object value);
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -2,14 +2,13 @@
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
#if !NETCOREAPP
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.ServiceModel.Description;
|
||||
using System.ServiceModel.Dispatcher;
|
||||
|
||||
namespace CefSharp.Internals
|
||||
namespace CefSharp.Internals.Wcf
|
||||
{
|
||||
internal sealed class JavascriptCallbackEndpointBehavior : IEndpointBehavior
|
||||
{
|
||||
@@ -47,4 +46,3 @@ namespace CefSharp.Internals
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+1
-3
@@ -2,14 +2,13 @@
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
#if !NETCOREAPP
|
||||
using System;
|
||||
using System.CodeDom;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace CefSharp.Internals
|
||||
namespace CefSharp.Internals.Wcf
|
||||
{
|
||||
internal sealed class JavascriptCallbackSurrogate : IDataContractSurrogate
|
||||
{
|
||||
@@ -71,4 +70,3 @@ namespace CefSharp.Internals
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2,13 +2,12 @@
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
#if !NETCOREAPP
|
||||
using System;
|
||||
using System.ServiceModel.Description;
|
||||
|
||||
namespace CefSharp.Internals
|
||||
namespace CefSharp.Internals.Wcf
|
||||
{
|
||||
internal static class WCFExtensions
|
||||
internal static class WcfExtensions
|
||||
{
|
||||
public static void ApplyOperationBehavior<T>(this ServiceDescription description,
|
||||
Func<OperationDescription, T> behaviorFactory,
|
||||
@@ -53,4 +52,3 @@ namespace CefSharp.Internals
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+62
-32
@@ -45,6 +45,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.Example.netcore",
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.WinForms.Example.netcore", "CefSharp.WinForms.Example\CefSharp.WinForms.Example.netcore.csproj", "{64E47346-0BB1-4DF7-B135-12D70E1F2F32}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.BrowserSubprocess.netcore", "CefSharp.BrowserSubprocess\CefSharp.BrowserSubprocess.netcore.csproj", "{FBFBD752-467C-444F-93E4-80D6242E8513}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.Wpf.Example.netcore", "CefSharp.Wpf.Example\CefSharp.Wpf.Example.netcore.csproj", "{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.OffScreen.Example.netcore", "CefSharp.OffScreen.Example\CefSharp.OffScreen.Example.netcore.csproj", "{A430C9D4-0952-44A2-989A-23C476B7A1F0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
@@ -77,38 +83,38 @@ Global
|
||||
{6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|x64.Build.0 = Release|x64
|
||||
{6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|x86.Build.0 = Release|Win32
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x64.Build.0 = Debug|x64
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x86.Build.0 = Debug|x86
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x64.ActiveCfg = Release|x64
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x64.Build.0 = Release|x64
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x86.ActiveCfg = Release|x86
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x86.Build.0 = Release|x86
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x64.Build.0 = Debug|x64
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x86.Build.0 = Debug|x86
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x64.ActiveCfg = Release|x64
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x64.Build.0 = Release|x64
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x86.ActiveCfg = Release|x86
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x86.Build.0 = Release|x86
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x64.Build.0 = Debug|x64
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x86.Build.0 = Debug|x86
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x64.ActiveCfg = Release|x64
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x64.Build.0 = Release|x64
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x86.ActiveCfg = Release|x86
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x86.Build.0 = Release|x86
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x64.Build.0 = Debug|x64
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x86.Build.0 = Debug|x86
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x64.ActiveCfg = Release|x64
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x64.Build.0 = Release|x64
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x86.ActiveCfg = Release|x86
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x86.Build.0 = Release|x86
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x64.Build.0 = Release|Any CPU
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x86.Build.0 = Release|Any CPU
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x64.Build.0 = Release|Any CPU
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x86.Build.0 = Release|Any CPU
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x64.Build.0 = Release|Any CPU
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x86.Build.0 = Release|Any CPU
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x64.Build.0 = Release|Any CPU
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x86.Build.0 = Release|Any CPU
|
||||
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|x64.Build.0 = Debug|x64
|
||||
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|x86.ActiveCfg = Debug|x86
|
||||
@@ -117,6 +123,30 @@ Global
|
||||
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|x64.Build.0 = Release|x64
|
||||
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|x86.ActiveCfg = Release|x86
|
||||
{64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|x86.Build.0 = Release|x86
|
||||
{FBFBD752-467C-444F-93E4-80D6242E8513}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{FBFBD752-467C-444F-93E4-80D6242E8513}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{FBFBD752-467C-444F-93E4-80D6242E8513}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{FBFBD752-467C-444F-93E4-80D6242E8513}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{FBFBD752-467C-444F-93E4-80D6242E8513}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{FBFBD752-467C-444F-93E4-80D6242E8513}.Release|x64.Build.0 = Release|Any CPU
|
||||
{FBFBD752-467C-444F-93E4-80D6242E8513}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{FBFBD752-467C-444F-93E4-80D6242E8513}.Release|x86.Build.0 = Release|Any CPU
|
||||
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x64.Build.0 = Debug|x64
|
||||
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x86.Build.0 = Debug|x86
|
||||
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x64.ActiveCfg = Release|x64
|
||||
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x64.Build.0 = Release|x64
|
||||
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x86.ActiveCfg = Release|x86
|
||||
{E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x86.Build.0 = Release|x86
|
||||
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x64.Build.0 = Debug|x64
|
||||
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x86.Build.0 = Debug|x86
|
||||
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x64.ActiveCfg = Release|x64
|
||||
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x64.Build.0 = Release|x64
|
||||
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x86.ActiveCfg = Release|x86
|
||||
{A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user