首次提交:添加src文件夹代码

This commit is contained in:
2026-02-27 14:02:43 +08:00
commit d330cfbca7
4184 changed files with 5546478 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,27 @@
Copyright (C) Microsoft Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* The name of Microsoft Corporation, or the names of its contributors
may not be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,85 @@
NOTICES AND INFORMATION
Do Not Translate or Localize
This software incorporates material from third parties. Microsoft makes certain
open source code available at https://3rdpartysource.microsoft.com, or you may
send a check or money order for US $5.00, including the product name, the open
source component name, and version number, to:
Source Code Compliance Team
Microsoft Corporation
One Microsoft Way
Redmond, WA 98052
USA
Notwithstanding any other terms, you may reverse engineer this software to the
extent required to debug changes to any libraries licensed under the GNU Lesser
General Public License.
----------------------------------------------------------------
Antlr3.Runtime 3.5.2-rc1 - BSD 3-Clause
[The "BSD license"]
Copyright (c) 2011 The ANTLR Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------
---------------------------------------------------------
StringTemplate4 4.0.9-rc1 - BSD 3-Clause
[The "BSD license"]
Copyright (c) 2011 The ANTLR Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,201 @@
<?xml version="1.0"?>
<!--
***********************************************************************************************
Copyright (C) Microsoft Corporation. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
***********************************************************************************************
-->
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Only do this for MSBuild versions below 16.0
as it is since done automatically, see https://github.com/microsoft/msbuild/pull/3605
-->
<MSBuildAllProjects Condition="'$(MSBuildToolsVersion)' &lt;= '15'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup>
<WebView2EnablePropertyPage Condition="'$(WebView2EnablePropertyPage)' == '' and '$(WebView2ProjectKind)' == 'native'">true</WebView2EnablePropertyPage>
<WebView2EnablePropertyPage Condition="'$(WebView2EnablePropertyPage)' == '' and '$(VisualStudioVersion)' &gt;= '17.0' and '$(Language)' != 'VB'">true</WebView2EnablePropertyPage>
</PropertyGroup>
<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)\WebView2Rules.Project.xml" Condition="'$(WebView2EnablePropertyPage)' == 'true'">
<Context>Project</Context>
</PropertyPageSchema>
</ItemGroup>
<!-- The Platform property is Win32 or x64 for C++ projects. Convert from Win32 to x86 to match our directory structure.
If PlatformTarget property is set, then use that to determine EffectivePlatform for .NET projects.
See conditions: https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-conditions?view=vs-2019
and PropertyGroup: https://docs.microsoft.com/en-us/visualstudio/msbuild/propertygroup-element-msbuild?view=vs-2019
-->
<PropertyGroup>
<EffectivePlatform>$(Platform)</EffectivePlatform>
<EffectivePlatform Condition="'$(EffectivePlatform)' == 'Win32'">x86</EffectivePlatform>
<EffectivePlatform Condition="'$(EffectivePlatform)' == 'Any CPU'">x86</EffectivePlatform>
<EffectivePlatform Condition="'$(EffectivePlatform)' == 'AnyCPU'">x86</EffectivePlatform>
<EffectivePlatform Condition="'$(NETCoreSdkRuntimeIdentifier)' == 'win-x86'">x86</EffectivePlatform>
<EffectivePlatform Condition="'$(NETCoreSdkRuntimeIdentifier)' == 'win-x64'">x64</EffectivePlatform>
<EffectivePlatform Condition="'$(PlatformTarget)' == 'x64'">x64</EffectivePlatform>
<EffectivePlatform Condition="'$(PlatformTarget)' == 'x86'">x86</EffectivePlatform>
<EffectivePlatform Condition="'$(PlatformTarget)' == 'Any CPU' And '$(WebView2ProjectKind)' == 'managed'">anycpu</EffectivePlatform>
<EffectivePlatform Condition="'$(PlatformTarget)' == 'AnyCPU' And '$(WebView2ProjectKind)' == 'managed'">anycpu</EffectivePlatform>
<!-- Some .NET projects created from Visual Studio's New Project templates don't always specify PlatformTarget (mostly library projects).
When PlatformTarget isn't specified, the C# compiler (and presumably other .NET compilers) targets AnyCPU by default.
However, without the line below we would end up with an EffectivePlatform of x86.
The result was that the project's output contained an exe targeting AnyCPU, but only an x86 WebView2Loader.dll.
Therefore, trying to run the built project on x64 or ARM64 would fail due to lack of matching WebView2Loader.dll.
The below line fixes that problem by setting EffectivePlatform to AnyCPU if PlatformTarget isn't defined.
I had expected that solution to break C++ projects, however, because I thought that PlatformTarget was only ever used in .NET projects.
That prompted me to add the extra check for WebView2ProjectKind being 'managed', to limit the scope to .NET projects.
Interestingly, testing has determined that the extra check isn't actually necessary.
C++ projects will build successfully without that extra check, so apparently they also define/use PlatformTarget.
I still felt safer leaving the extra check in, though, because it never makes sense for a native project to attempt to target AnyCPU.
For the same reason, I also added the extra check to existing lines above this one which target AnyCPU.
-->
<EffectivePlatform Condition="'$(PlatformTarget)' == '' And '$(WebView2ProjectKind)' == 'managed'">anycpu</EffectivePlatform>
</PropertyGroup>
<!-- Define custom properties to provide the ability to change default WebView2 build behaviors.
See MSBuild properties: https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-properties?view=vs-2019
-->
<PropertyGroup>
<!-- For cases where it's non-obvious that we need to expose the WinMD (such as in a C++ non-UAP app) the dev can
set the WebView2UseWinRT property to 'true'.
-->
<WebView2UseWinRT Condition="'$(WebView2UseWinRT)' == '' And '$(TargetPlatformIdentifier)' == 'UAP'">true</WebView2UseWinRT>
<!-- Switch between using a static library or a dll for the WebView2Loader.
'Dynamic' value to use the WebView2Loader.dll, 'Static' value to static lib.
For WinRT, use 'None' and skip copy/link of the loader as it's already linked
to the WebView2 WinRT component.
For wv2winrt, if the project is running the tool, it's either:
1. Using WebView2 WinRT, and does not need the loader
2. Using WebView2 Win32, and needs the loader. Defaulting to include will break case below.
3. Not using WebView2 APIs at all, and doesn't need the loader.
We're choosing the most common scenario from (2), (3) above and defaulting to not including the loader.
-->
<WebView2LoaderPreference Condition="'$(WebView2LoaderPreference)' == '' And ('$(WebView2UseWinRT)' == 'true' Or '$(WebView2UseDispatchAdapter)' == 'true')">None</WebView2LoaderPreference>
<WebView2LoaderPreference Condition="'$(WebView2LoaderPreference)' == ''">Dynamic</WebView2LoaderPreference>
</PropertyGroup>
<Import Project="$(NugetRoot)\build\wv2winrt.targets"/>
<!-- Make our header path available in the include path.
See CL task: https://docs.microsoft.com/en-us/visualstudio/msbuild/cl-task?view=vs-2019
-->
<ItemDefinitionGroup>
<ClCompile>
<!-- MSBuildThisFileDirectory is the path containing this targets file.
See well-known properties: https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-reserved-and-well-known-properties?view=vs-2019
-->
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)native\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<!-- Update link path to include appropriate arch directory and link against our lib.
See Link task: https://docs.microsoft.com/en-us/visualstudio/msbuild/link-task?view=vs-2019
-->
<ItemDefinitionGroup>
<Link Condition="'$(EffectivePlatform)' != 'ARM'">
<WebView2LoaderLib Condition="'$(WebView2LoaderPreference)' == 'Static'">WebView2LoaderStatic.lib;version.lib</WebView2LoaderLib>
<AdditionalDependencies>%(WebView2LoaderLib);WebView2Loader.dll.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)native\$(EffectivePlatform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<!-- Copy DLL to the output path.
Only Copy DLL to the output path when project is C++ and WebView2LoaderPreference is set to Dynamic.
.NET will pick DLL at runtime from runtime folder or processor bit folder base on Core or Framework.
See Content: https://docs.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-items?view=vs-2019
See Architecture-specific folders for .NET:
https://docs.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks#architecture-specific-folders
-->
<ItemGroup Condition="'$(WebView2LoaderPreference)' == 'Dynamic' And '$(WebView2ProjectKind)' == 'native' And '$(EffectivePlatform)' != 'ARM'">
<Content Include="$(MSBuildThisFileDirectory)native\$(EffectivePlatform)\WebView2Loader.dll">
<Link>%(Filename)%(Extension)</Link>
<PublishState>Included</PublishState>
<Visible>False</Visible>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Pack>false</Pack>
</Content>
</ItemGroup>
<!-- Copy x64, x86 and arm64 WebView2Loader.dlls to sub folders in the output path. For .NET Framework we match
the folder convention used by .NET Core for consistency.
Microsoft.Web.WebView2.Core.dll handles loading the right DLL at runtime for Any CPU under those sub folders.
For SDK style project, check for TargetFramework. For msbuild style, check to make sure project is not C++ and TargetFrameworkVersion equal to v after trimming all numbers and dots.
When using WinRT, the loader is statically linked into the Microsoft.Web.WebView2.Core.dll.
https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-target-framework-and-target-platform?view=vs-2019#target-framework-and-profile
-->
<ItemGroup Condition="'$(WebView2ProjectKind)' == 'managed' And '$(WebView2UseWinRT)' != 'true'">
<Content Include="$(MSBuildThisFileDirectory)\..\runtimes\win-x86\native\WebView2Loader.dll" Condition="'$(EffectivePlatform)' == 'x86' Or '$(EffectivePlatform)' == 'anycpu'">
<Link>runtimes\win-x86\native\WebView2Loader.dll</Link>
<PublishState>Included</PublishState>
<Visible>False</Visible>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVsix>true</IncludeInVsix>
<Pack>false</Pack>
</Content>
<Content Include="$(MSBuildThisFileDirectory)\..\runtimes\win-x64\native\WebView2Loader.dll" Condition="'$(EffectivePlatform)' == 'x64' Or '$(EffectivePlatform)' == 'anycpu'">
<Link>runtimes\win-x64\native\WebView2Loader.dll</Link>
<PublishState>Included</PublishState>
<Visible>False</Visible>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVsix>true</IncludeInVsix>
<Pack>false</Pack>
</Content>
<Content Include="$(MSBuildThisFileDirectory)\..\runtimes\win-arm64\native\WebView2Loader.dll" Condition="'$(EffectivePlatform)' == 'arm64' Or '$(EffectivePlatform)' == 'anycpu'">
<Link>runtimes\win-arm64\native\WebView2Loader.dll</Link>
<PublishState>Included</PublishState>
<Visible>False</Visible>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVsix>true</IncludeInVsix>
<Pack>false</Pack>
</Content>
</ItemGroup>
<!-- Setup WinRT DLLs.
See: https://docs.microsoft.com/en-us/nuget/guides/create-uwp-packages
-->
<ItemDefinitionGroup Condition="'$(WebView2UseWinRT)' == 'true'">
<ClCompile>
<!-- MSBuildThisFileDirectory is the path containing this targets file.
See well-known properties: https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-reserved-and-well-known-properties?view=vs-2019
-->
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)native\include-winrt\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<Choose>
<!-- We are using a Choose/When here instead of a condition directly on the ItemGroup to workaround a VS file inclusion issue that was causing false warnings. -->
<When Condition="'$(WebView2UseWinRT)' == 'true'">
<ItemGroup>
<Reference Include="$(MSBuildThisFileDirectory)..\lib\Microsoft.Web.WebView2.Core.winmd" Condition="'$(EffectivePlatform)' != 'ARM'">
<Implementation>Microsoft.Web.WebView2.Core.dll</Implementation>
</Reference>
<Reference Include="$(MSBuildThisFileDirectory)..\lib\Microsoft.Web.WebView2.Core.winmd" Condition="'$(EffectivePlatform)' == 'ARM'">
<!-- We don't support ARM, but to support builds we allow access to the winmd without specifying the implementing dll -->
</Reference>
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\runtimes\win-$(EffectivePlatform)\native_uap\Microsoft.Web.WebView2.Core.dll" Condition="'$(EffectivePlatform)' != 'ARM'"/>
<!-- We limit the SDKReference to 'UAP' because it targets 'UAP' as well, and would conflict if used in an app targeting 'Windows' -->
<SDKReference Include="Microsoft.VCLibs.Desktop, Version=14.0" Condition="'$(TargetPlatformIdentifier)' == 'UAP'"/>
</ItemGroup>
</When>
<When Condition="'$(WebView2UseWinRT)' == 'false' and '$(WebView2UseDispatchAdapter)' == 'true'">
<ItemGroup>
<Reference Include="$(MSBuildThisFileDirectory)..\lib\Microsoft.Web.WebView2.Core.winmd">
<!-- wv2winrt needs Dispatch Adapter metadata to generate code -->
</Reference>
</ItemGroup>
</When>
</Choose>
<!-- Cleanup our copied files when cleaning.
See Delete: https://docs.microsoft.com/en-us/visualstudio/msbuild/delete-task?view=vs-2019
See AfterTargets: https://docs.microsoft.com/en-us/visualstudio/msbuild/target-build-order?view=vs-2019
-->
<Target Name="CleanDownloadContentFiles" AfterTargets="Clean">
<Delete Files="$(OutputPath)\WebView2Loader.dll"/>
</Target>
</Project>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- This build/.targets file is used by managed VS projects including win32
apps and UWP apps. -->
<PropertyGroup>
<WebView2ProjectKind>managed</WebView2ProjectKind>
</PropertyGroup>
<PropertyGroup>
<!-- The managed targets file is under build
so the root is one path segment up. -->
<NugetRoot>$(MSBuildThisFileDirectory)..\</NugetRoot>
</PropertyGroup>
<!-- Example logging
<Target Name="WebView2ManagedEntryLog" BeforeTargets="Build">
<Message Text="WebView2 managed .targets file. $(NugetRoot)" Importance="high"/>
</Target>
-->
<Import Project="$(NugetRoot)\build\Common.targets"/>
</Project>

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<Rule Name="WebView2" DisplayName="WebView2" Order="75" PageTemplate="generic" xmlns="http://schemas.microsoft.com/build/2009/properties">
<Rule.Categories>
<Category Name="General" DisplayName="General" />
<Category Name="wv2winrt" DisplayName="WinRT in Script" />
</Rule.Categories>
<Rule.DataSource>
<DataSource Persistence="ProjectFile" HasConfigurationCondition="false" Label="Globals" />
</Rule.DataSource>
<BoolProperty Name="WebView2UseWinRT"
DisplayName="Use WebView2 WinRT APIs"
Description="Enables the WebView2 WinRT APIs for this project"
Category="General" />
<EnumProperty Name="WebView2LoaderPreference"
DisplayName="Loader preference"
Description="Switch between using a static library or a DLL for the WebView2Loader"
Category="General">
<EnumValue Name="Dynamic" DisplayName="Dynamic" Description="Sets the project to use a DLL for the WebView2Loader" />
<EnumValue Name="Static" DisplayName="Static" Description="Sets the project to use a static library for the WebView2Loader" />
</EnumProperty>
<BoolProperty Name="WebView2UseDispatchAdapter"
DisplayName="Use the wv2winrt tool"
Description="Uses the wv2winrt tool that allows you to use WinRT objects with CoreWebView2.AddHostObjectToScript."
Category="wv2winrt" />
<StringProperty Name="WebView2DispatchAdapterOutputDir"
DisplayName="Output directory"
Description="Specifies the directory where source files generated by wv2winrt will be saved."
Category="wv2winrt" />
<StringProperty Name="WebView2DispatchAdapterNamespace"
DisplayName="Output namespace"
Description="Namespace where types generated by wv2winrt will be placed."
Category="wv2winrt" />
<BoolProperty Name="WebView2DispatchAdapterUseJavaScriptCase"
DisplayName="Use JavaScript case"
Description="Enables JavaScript casing in wv2winrt generated types"
Category="wv2winrt" />
<EnumProperty Name="WV2WinRTVerbosity"
DisplayName="Verbosity"
Description="Sets the importance of wv2winrt build messages"
Category="wv2winrt">
<EnumValue Name="low" DisplayName="low" Description="Enables messages when MSBuild verbosity is set to at least 'detailed'" />
<EnumValue Name="normal" DisplayName="normal" Description="Enables messages when MSBuild verbosity is set to at least 'normal'" />
<EnumValue Name="high" DisplayName="high" Description="Enables messages when MSBuild verbosity is set to at least 'minimal'" />
</EnumProperty>
<BoolProperty Name="WV2WinRTExplicitIncludesOnly"
DisplayName="Explicit includes only"
Description="Instead of implicitly including types referenced by included types, only types explicitly listed in an include will be included by wv2winrt."
Category="wv2winrt" />
<BoolProperty Name="WV2WinRTRequireAllowForWebAttribute"
DisplayName="AllowForWeb attribute is required"
Description="Only types with the 'AllowForWeb' attribute will be included by wv2winrt."
Category="wv2winrt" />
<BoolProperty Name="WV2WinRTIgnoreWebHostHiddenAttribute"
DisplayName="WebHostHidden attribute is ignored"
Description="Instead of excluding types with the 'WebHostHidden' attribute, ignore the attribute when deciding to include or exclude types."
Category="wv2winrt" />
<BoolProperty Name="WV2WinRTDisallowEmptyAdapter"
DisplayName="Disallow empty adapter"
Description="Enables build error when there are no winmd reference inputs to wv2winrt"
Category="wv2winrt" />
<BoolProperty Name="WV2WinRTWrapWebViewTypes"
DisplayName="Wrap WebView2 types"
Description="Includes WebView2 types in the types generated by wv2winrt"
Category="wv2winrt" />
<BoolProperty Name="WebView2WinRTWrapSystemTypes"
DisplayName="Wrap system types"
Description="Includes WinRT types from the Windows SDK in the types generated by wv2winrt"
Category="wv2winrt" />
<EnumProperty Name="WV2WinRTPlatformReferencesLevel"
DisplayName="Platform references level"
Description="Sets the level of platform references to take as input to wv2winrt. Changes to this property have the most impact for Desktop projects, where the default of matching C++/WinRT can have a dramatic impact on binary size. Setting this property to a value different to the default one may require manually adding references to WebView2WinRTAdditionalWinMDReferences."
Category="wv2winrt">
<EnumValue Name="explicit" DisplayName="Explicit references" Description="Resolves to platform references already resolved by the project. Behavior may vary depending on the project's target platform (UAP/Desktop)." />
<EnumValue Name="foundation" DisplayName="Explicit references + Foundation contracts" Description="Resolves to explicit references + Foundation contracts from the SDK referenced by this project." />
<EnumValue Name="match" DisplayName="Match C++/WinRT" Description="Resolves to the references set by C++/WinRT." />
</EnumProperty>
<StringListProperty Name="WebView2WinRTAdditionalWinMDReferences"
DisplayName="Additional WinMD references"
Description="List of paths to additional WinMD files to provide to wv2winrt"
Category="wv2winrt" />
<StringListProperty Name="WebView2DispatchAdapterIncludeFilters"
DisplayName="Include filters"
Description="List of namespaces or runtimeclass full names used to match types to include from referenced WinMD files"
Category="wv2winrt" />
<StringListProperty Name="WebView2DispatchAdapterExcludeFilters"
DisplayName="Exclude filters"
Description="List of namespaces or runtimeclass full names used to match types to exclude from referenced WinMD files"
Category="wv2winrt" />
</Rule>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- This build\native\.targets file is used by native (C++) VS projects including win32 and UWP. -->
<PropertyGroup>
<WebView2ProjectKind>native</WebView2ProjectKind>
</PropertyGroup>
<PropertyGroup>
<!-- The native targets file is under build\native
so the root is two path segments up. -->
<NugetRoot>$(MSBuildThisFileDirectory)..\..\</NugetRoot>
</PropertyGroup>
<!-- Example logging
<Target Name="WebView2NativeEntryLog" BeforeTargets="Build">
<Message Text="WebView2 native .targets file. $(NugetRoot)" Importance="high"/>
</Target>
-->
<Import Project="$(NugetRoot)\build\Common.targets"/>
</Project>

View File

@@ -0,0 +1,546 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.xx.xxxx */
/* at a redacted point in time
*/
/* Compiler settings for ../../edge_embedded_browser/client/win/current/webview2interop.idl:
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.xx.xxxx
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif /* __RPCNDR_H_VERSION__ */
#ifndef __webview2interop_h__
#define __webview2interop_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
#ifndef DECLSPEC_XFGVIRT
#if defined(_CONTROL_FLOW_GUARD_XFG)
#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func))
#else
#define DECLSPEC_XFGVIRT(base, func)
#endif
#endif
/* Forward Declarations */
#ifndef __ICoreWebView2Interop_FWD_DEFINED__
#define __ICoreWebView2Interop_FWD_DEFINED__
typedef interface ICoreWebView2Interop ICoreWebView2Interop;
#endif /* __ICoreWebView2Interop_FWD_DEFINED__ */
#ifndef __ICoreWebView2CompositionControllerInterop_FWD_DEFINED__
#define __ICoreWebView2CompositionControllerInterop_FWD_DEFINED__
typedef interface ICoreWebView2CompositionControllerInterop ICoreWebView2CompositionControllerInterop;
#endif /* __ICoreWebView2CompositionControllerInterop_FWD_DEFINED__ */
#ifndef __ICoreWebView2CompositionControllerInterop2_FWD_DEFINED__
#define __ICoreWebView2CompositionControllerInterop2_FWD_DEFINED__
typedef interface ICoreWebView2CompositionControllerInterop2 ICoreWebView2CompositionControllerInterop2;
#endif /* __ICoreWebView2CompositionControllerInterop2_FWD_DEFINED__ */
#ifndef __ICoreWebView2EnvironmentInterop_FWD_DEFINED__
#define __ICoreWebView2EnvironmentInterop_FWD_DEFINED__
typedef interface ICoreWebView2EnvironmentInterop ICoreWebView2EnvironmentInterop;
#endif /* __ICoreWebView2EnvironmentInterop_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#ifdef __cplusplus
extern "C"{
#endif
#ifndef __WebView2Interop_LIBRARY_DEFINED__
#define __WebView2Interop_LIBRARY_DEFINED__
/* library WebView2Interop */
/* [version][uuid] */
EXTERN_C const IID LIBID_WebView2Interop;
#ifndef __ICoreWebView2Interop_INTERFACE_DEFINED__
#define __ICoreWebView2Interop_INTERFACE_DEFINED__
/* interface ICoreWebView2Interop */
/* [unique][object][uuid] */
EXTERN_C __declspec(selectany) const IID IID_ICoreWebView2Interop = {0x912b34a7,0xd10b,0x49c4,{0xaf,0x18,0x7c,0xb7,0xe6,0x04,0xe0,0x1a}};
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("912b34a7-d10b-49c4-af18-7cb7e604e01a")
ICoreWebView2Interop : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE AddHostObjectToScript(
/* [in] */ LPCWSTR name,
/* [in] */ VARIANT *object) = 0;
};
#else /* C style interface */
typedef struct ICoreWebView2InteropVtbl
{
BEGIN_INTERFACE
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICoreWebView2Interop * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICoreWebView2Interop * This);
DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ICoreWebView2Interop * This);
DECLSPEC_XFGVIRT(ICoreWebView2Interop, AddHostObjectToScript)
HRESULT ( STDMETHODCALLTYPE *AddHostObjectToScript )(
ICoreWebView2Interop * This,
/* [in] */ LPCWSTR name,
/* [in] */ VARIANT *object);
END_INTERFACE
} ICoreWebView2InteropVtbl;
interface ICoreWebView2Interop
{
CONST_VTBL struct ICoreWebView2InteropVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICoreWebView2Interop_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICoreWebView2Interop_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICoreWebView2Interop_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICoreWebView2Interop_AddHostObjectToScript(This,name,object) \
( (This)->lpVtbl -> AddHostObjectToScript(This,name,object) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICoreWebView2Interop_INTERFACE_DEFINED__ */
#ifndef __ICoreWebView2CompositionControllerInterop_INTERFACE_DEFINED__
#define __ICoreWebView2CompositionControllerInterop_INTERFACE_DEFINED__
/* interface ICoreWebView2CompositionControllerInterop */
/* [unique][object][uuid] */
EXTERN_C __declspec(selectany) const IID IID_ICoreWebView2CompositionControllerInterop = {0x8e9922ce,0x9c80,0x42e6,{0xba,0xd7,0xfc,0xeb,0xf2,0x91,0xa4,0x95}};
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8e9922ce-9c80-42e6-bad7-fcebf291a495")
ICoreWebView2CompositionControllerInterop : public IUnknown
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_AutomationProvider(
/* [retval][out] */ IUnknown **provider) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_RootVisualTarget(
/* [retval][out] */ IUnknown **target) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_RootVisualTarget(
/* [in] */ IUnknown *target) = 0;
};
#else /* C style interface */
typedef struct ICoreWebView2CompositionControllerInteropVtbl
{
BEGIN_INTERFACE
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICoreWebView2CompositionControllerInterop * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICoreWebView2CompositionControllerInterop * This);
DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ICoreWebView2CompositionControllerInterop * This);
DECLSPEC_XFGVIRT(ICoreWebView2CompositionControllerInterop, get_AutomationProvider)
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_AutomationProvider )(
ICoreWebView2CompositionControllerInterop * This,
/* [retval][out] */ IUnknown **provider);
DECLSPEC_XFGVIRT(ICoreWebView2CompositionControllerInterop, get_RootVisualTarget)
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_RootVisualTarget )(
ICoreWebView2CompositionControllerInterop * This,
/* [retval][out] */ IUnknown **target);
DECLSPEC_XFGVIRT(ICoreWebView2CompositionControllerInterop, put_RootVisualTarget)
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_RootVisualTarget )(
ICoreWebView2CompositionControllerInterop * This,
/* [in] */ IUnknown *target);
END_INTERFACE
} ICoreWebView2CompositionControllerInteropVtbl;
interface ICoreWebView2CompositionControllerInterop
{
CONST_VTBL struct ICoreWebView2CompositionControllerInteropVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICoreWebView2CompositionControllerInterop_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICoreWebView2CompositionControllerInterop_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICoreWebView2CompositionControllerInterop_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICoreWebView2CompositionControllerInterop_get_AutomationProvider(This,provider) \
( (This)->lpVtbl -> get_AutomationProvider(This,provider) )
#define ICoreWebView2CompositionControllerInterop_get_RootVisualTarget(This,target) \
( (This)->lpVtbl -> get_RootVisualTarget(This,target) )
#define ICoreWebView2CompositionControllerInterop_put_RootVisualTarget(This,target) \
( (This)->lpVtbl -> put_RootVisualTarget(This,target) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICoreWebView2CompositionControllerInterop_INTERFACE_DEFINED__ */
#ifndef __ICoreWebView2CompositionControllerInterop2_INTERFACE_DEFINED__
#define __ICoreWebView2CompositionControllerInterop2_INTERFACE_DEFINED__
/* interface ICoreWebView2CompositionControllerInterop2 */
/* [unique][object][uuid] */
EXTERN_C __declspec(selectany) const IID IID_ICoreWebView2CompositionControllerInterop2 = {0x6b47bbe1,0x2480,0x4ff8,{0xa5,0xba,0x69,0xc2,0xf0,0xb8,0x68,0xb3}};
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("6b47bbe1-2480-4ff8-a5ba-69c2f0b868b3")
ICoreWebView2CompositionControllerInterop2 : public ICoreWebView2CompositionControllerInterop
{
public:
virtual HRESULT STDMETHODCALLTYPE DragEnter(
/* [in] */ IDataObject *dataObject,
/* [in] */ DWORD keyState,
/* [in] */ POINT point,
/* [retval][out] */ DWORD *effect) = 0;
virtual HRESULT STDMETHODCALLTYPE DragLeave( void) = 0;
virtual HRESULT STDMETHODCALLTYPE DragOver(
/* [in] */ DWORD keyState,
/* [in] */ POINT point,
/* [retval][out] */ DWORD *effect) = 0;
virtual HRESULT STDMETHODCALLTYPE Drop(
/* [in] */ IDataObject *dataObject,
/* [in] */ DWORD keyState,
/* [in] */ POINT point,
/* [retval][out] */ DWORD *effect) = 0;
};
#else /* C style interface */
typedef struct ICoreWebView2CompositionControllerInterop2Vtbl
{
BEGIN_INTERFACE
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICoreWebView2CompositionControllerInterop2 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICoreWebView2CompositionControllerInterop2 * This);
DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ICoreWebView2CompositionControllerInterop2 * This);
DECLSPEC_XFGVIRT(ICoreWebView2CompositionControllerInterop, get_AutomationProvider)
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_AutomationProvider )(
ICoreWebView2CompositionControllerInterop2 * This,
/* [retval][out] */ IUnknown **provider);
DECLSPEC_XFGVIRT(ICoreWebView2CompositionControllerInterop, get_RootVisualTarget)
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_RootVisualTarget )(
ICoreWebView2CompositionControllerInterop2 * This,
/* [retval][out] */ IUnknown **target);
DECLSPEC_XFGVIRT(ICoreWebView2CompositionControllerInterop, put_RootVisualTarget)
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_RootVisualTarget )(
ICoreWebView2CompositionControllerInterop2 * This,
/* [in] */ IUnknown *target);
DECLSPEC_XFGVIRT(ICoreWebView2CompositionControllerInterop2, DragEnter)
HRESULT ( STDMETHODCALLTYPE *DragEnter )(
ICoreWebView2CompositionControllerInterop2 * This,
/* [in] */ IDataObject *dataObject,
/* [in] */ DWORD keyState,
/* [in] */ POINT point,
/* [retval][out] */ DWORD *effect);
DECLSPEC_XFGVIRT(ICoreWebView2CompositionControllerInterop2, DragLeave)
HRESULT ( STDMETHODCALLTYPE *DragLeave )(
ICoreWebView2CompositionControllerInterop2 * This);
DECLSPEC_XFGVIRT(ICoreWebView2CompositionControllerInterop2, DragOver)
HRESULT ( STDMETHODCALLTYPE *DragOver )(
ICoreWebView2CompositionControllerInterop2 * This,
/* [in] */ DWORD keyState,
/* [in] */ POINT point,
/* [retval][out] */ DWORD *effect);
DECLSPEC_XFGVIRT(ICoreWebView2CompositionControllerInterop2, Drop)
HRESULT ( STDMETHODCALLTYPE *Drop )(
ICoreWebView2CompositionControllerInterop2 * This,
/* [in] */ IDataObject *dataObject,
/* [in] */ DWORD keyState,
/* [in] */ POINT point,
/* [retval][out] */ DWORD *effect);
END_INTERFACE
} ICoreWebView2CompositionControllerInterop2Vtbl;
interface ICoreWebView2CompositionControllerInterop2
{
CONST_VTBL struct ICoreWebView2CompositionControllerInterop2Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICoreWebView2CompositionControllerInterop2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICoreWebView2CompositionControllerInterop2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICoreWebView2CompositionControllerInterop2_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICoreWebView2CompositionControllerInterop2_get_AutomationProvider(This,provider) \
( (This)->lpVtbl -> get_AutomationProvider(This,provider) )
#define ICoreWebView2CompositionControllerInterop2_get_RootVisualTarget(This,target) \
( (This)->lpVtbl -> get_RootVisualTarget(This,target) )
#define ICoreWebView2CompositionControllerInterop2_put_RootVisualTarget(This,target) \
( (This)->lpVtbl -> put_RootVisualTarget(This,target) )
#define ICoreWebView2CompositionControllerInterop2_DragEnter(This,dataObject,keyState,point,effect) \
( (This)->lpVtbl -> DragEnter(This,dataObject,keyState,point,effect) )
#define ICoreWebView2CompositionControllerInterop2_DragLeave(This) \
( (This)->lpVtbl -> DragLeave(This) )
#define ICoreWebView2CompositionControllerInterop2_DragOver(This,keyState,point,effect) \
( (This)->lpVtbl -> DragOver(This,keyState,point,effect) )
#define ICoreWebView2CompositionControllerInterop2_Drop(This,dataObject,keyState,point,effect) \
( (This)->lpVtbl -> Drop(This,dataObject,keyState,point,effect) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICoreWebView2CompositionControllerInterop2_INTERFACE_DEFINED__ */
#ifndef __ICoreWebView2EnvironmentInterop_INTERFACE_DEFINED__
#define __ICoreWebView2EnvironmentInterop_INTERFACE_DEFINED__
/* interface ICoreWebView2EnvironmentInterop */
/* [unique][object][uuid] */
EXTERN_C __declspec(selectany) const IID IID_ICoreWebView2EnvironmentInterop = {0xee503a63,0xc1e2,0x4fbf,{0x8a,0x4d,0x82,0x4e,0x95,0xf8,0xbb,0x13}};
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("ee503a63-c1e2-4fbf-8a4d-824e95f8bb13")
ICoreWebView2EnvironmentInterop : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetAutomationProviderForWindow(
/* [in] */ HWND hwnd,
/* [retval][out] */ IUnknown **provider) = 0;
};
#else /* C style interface */
typedef struct ICoreWebView2EnvironmentInteropVtbl
{
BEGIN_INTERFACE
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ICoreWebView2EnvironmentInterop * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ICoreWebView2EnvironmentInterop * This);
DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ICoreWebView2EnvironmentInterop * This);
DECLSPEC_XFGVIRT(ICoreWebView2EnvironmentInterop, GetAutomationProviderForWindow)
HRESULT ( STDMETHODCALLTYPE *GetAutomationProviderForWindow )(
ICoreWebView2EnvironmentInterop * This,
/* [in] */ HWND hwnd,
/* [retval][out] */ IUnknown **provider);
END_INTERFACE
} ICoreWebView2EnvironmentInteropVtbl;
interface ICoreWebView2EnvironmentInterop
{
CONST_VTBL struct ICoreWebView2EnvironmentInteropVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ICoreWebView2EnvironmentInterop_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ICoreWebView2EnvironmentInterop_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ICoreWebView2EnvironmentInterop_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ICoreWebView2EnvironmentInterop_GetAutomationProviderForWindow(This,hwnd,provider) \
( (This)->lpVtbl -> GetAutomationProviderForWindow(This,hwnd,provider) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ICoreWebView2EnvironmentInterop_INTERFACE_DEFINED__ */
#endif /* __WebView2Interop_LIBRARY_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,142 @@
// Copyright (C) Microsoft Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import "oaidl.idl";
[uuid(79b85709-2a19-4645-9722-3cc51b86eda7), version(1.0)]
library WebView2Interop {
// Forward declarations
interface ICoreWebView2Interop;
interface ICoreWebView2CompositionControllerInterop;
interface ICoreWebView2CompositionControllerInterop2;
// Enums and structs
// End of enums and structs
/// Interop interface for the CoreWebView2 WinRT object to allow WinRT end
/// developers to be able to use COM interfaces as parameters for some methods.
/// This interface is implemented by the Microsoft.Web.WebView2.Core.CoreWebView2
/// runtime class.
[uuid(912b34a7-d10b-49c4-af18-7cb7e604e01a), object, pointer_default(unique)]
interface ICoreWebView2Interop : IUnknown {
/// Add the provided host object to script running in the WebView with the
/// specified name.
/// See the documentation for ICoreWebView2::AddHostObjectToScript for more
/// information.
HRESULT AddHostObjectToScript([in] LPCWSTR name, [in] VARIANT* object);
}
/// Interop interface for the CoreWebView2CompositionController WinRT object to
/// allow WinRT end developers to be able to use the COM interfaces as parameters
/// for some methods.
/// This interface is implemented by the Microsoft.Web.WebView2.Core.CoreWebView2CompositionController
/// runtime class.
[uuid(8e9922ce-9c80-42e6-bad7-fcebf291a495), object, pointer_default(unique)]
interface ICoreWebView2CompositionControllerInterop : IUnknown {
/// Returns the UI Automation Provider for the WebView. See the documentation for
/// ICoreWebView2CompositionController::AutomationProvider for more information.
[propget] HRESULT AutomationProvider([out, retval] IUnknown** provider);
/// The RootVisualTarget is a visual in the hosting app's visual tree. This
/// visual is where the WebView2 will connect its visual tree.
/// See the documentation for ICoreWebView2CompositionController::RootVisualTarget
/// for more information.
[propget] HRESULT RootVisualTarget([out, retval] IUnknown** target);
/// Set the RootVisualTarget property.
[propput] HRESULT RootVisualTarget([in] IUnknown* target);
}
/// This interface is the continuation of the
/// ICoreWebView2CompositionControllerInterop interface to manage drag and drop.
[uuid(6b47bbe1-2480-4ff8-a5ba-69c2f0b868b3), object, pointer_default(unique)]
interface ICoreWebView2CompositionControllerInterop2 : ICoreWebView2CompositionControllerInterop {
/// This function corresponds to [IDropTarget::DragEnter](/windows/win32/api/oleidl/nf-oleidl-idroptarget-dragenter).
///
/// This function has a dependency on AllowExternalDrop property of
/// CoreWebView2Controller and return E_FAIL to callers to indicate this
/// operation is not allowed if AllowExternalDrop property is set to false.
///
/// The hosting application must register as an IDropTarget and implement
/// and forward DragEnter calls to this function.
///
/// point parameter must be modified to include the WebView's offset and be in
/// the WebView's client coordinates (Similar to how SendMouseInput works).
///
/// \snippet DropTarget.cpp DragEnter
HRESULT DragEnter(
[in] IDataObject* dataObject,
[in] DWORD keyState,
[in] POINT point,
[out, retval] DWORD* effect);
/// This function corresponds to [IDropTarget::DragLeave](/windows/win32/api/oleidl/nf-oleidl-idroptarget-dragleave).
///
/// This function has a dependency on AllowExternalDrop property of
/// CoreWebView2Controller and return E_FAIL to callers to indicate this
/// operation is not allowed if AllowExternalDrop property is set to false.
///
/// The hosting application must register as an IDropTarget and implement
/// and forward DragLeave calls to this function.
///
/// \snippet DropTarget.cpp DragLeave
HRESULT DragLeave();
/// This function corresponds to [IDropTarget::DragOver](/windows/win32/api/oleidl/nf-oleidl-idroptarget-dragover).
///
/// This function has a dependency on AllowExternalDrop property of
/// CoreWebView2Controller and return E_FAIL to callers to indicate this
/// operation is not allowed if AllowExternalDrop property is set to false.
///
/// The hosting application must register as an IDropTarget and implement
/// and forward DragOver calls to this function.
///
/// point parameter must be modified to include the WebView's offset and be in
/// the WebView's client coordinates (Similar to how SendMouseInput works).
///
/// \snippet DropTarget.cpp DragOver
HRESULT DragOver(
[in] DWORD keyState,
[in] POINT point,
[out, retval] DWORD* effect);
/// This function corresponds to [IDropTarget::Drop](/windows/win32/api/oleidl/nf-oleidl-idroptarget-drop).
///
/// This function has a dependency on AllowExternalDrop property of
/// CoreWebView2Controller and return E_FAIL to callers to indicate this
/// operation is not allowed if AllowExternalDrop property is set to false.
///
/// The hosting application must register as an IDropTarget and implement
/// and forward Drop calls to this function.
///
/// point parameter must be modified to include the WebView's offset and be in
/// the WebView's client coordinates (Similar to how SendMouseInput works).
///
/// \snippet DropTarget.cpp Drop
HRESULT Drop(
[in] IDataObject* dataObject,
[in] DWORD keyState,
[in] POINT point,
[out, retval] DWORD* effect);
}
/// Interop interface for the CoreWebView2Environment WinRT object to allow
/// WinRT end developers to be able to use COM interfaces as parameters for some
/// methods.
/// This interface is implemented by the Microsoft.Web.WebView2.Core.CoreWebView2Environment
/// runtime class.
[uuid(ee503a63-c1e2-4fbf-8a4d-824e95f8bb13), object, pointer_default(unique)]
interface ICoreWebView2EnvironmentInterop : IUnknown {
/// Returns the UI Automation Provider for the
/// ICoreWebView2CompositionController that corresponds with the given HWND.
/// See the documentation for ICoreWebView2Environment::GetAutomationProviderForWindow
/// for more information.
HRESULT GetAutomationProviderForWindow([in] HWND hwnd,
[out, retval] IUnknown** provider);
}
// End of interfaces
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,406 @@
// Copyright (C) Microsoft Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef __core_webview2_environment_options_h__
#define __core_webview2_environment_options_h__
#include <objbase.h>
#include <wrl/implements.h>
#include "webview2.h"
#define CORE_WEBVIEW_TARGET_PRODUCT_VERSION L"126.0.2592.51"
#define COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(p) \
public: \
HRESULT STDMETHODCALLTYPE get_##p(LPWSTR* value) override { \
if (!value) \
return E_POINTER; \
*value = m_##p.Copy(); \
if ((*value == nullptr) && (m_##p.Get() != nullptr)) \
return HRESULT_FROM_WIN32(GetLastError()); \
return S_OK; \
} \
HRESULT STDMETHODCALLTYPE put_##p(LPCWSTR value) override { \
LPCWSTR result = m_##p.Set(value); \
if ((result == nullptr) && (value != nullptr)) \
return HRESULT_FROM_WIN32(GetLastError()); \
return S_OK; \
} \
\
protected: \
AutoCoMemString m_##p;
#define COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(p, defPVal) \
public: \
HRESULT STDMETHODCALLTYPE get_##p(BOOL* value) override { \
if (!value) \
return E_POINTER; \
*value = m_##p; \
return S_OK; \
} \
HRESULT STDMETHODCALLTYPE put_##p(BOOL value) override { \
m_##p = value; \
return S_OK; \
} \
\
protected: \
BOOL m_##p = defPVal ? TRUE : FALSE;
#define DEFINE_AUTO_COMEM_STRING() \
protected: \
class AutoCoMemString { \
public: \
AutoCoMemString() {} \
~AutoCoMemString() { Release(); } \
void Release() { \
if (m_string) { \
deallocate_fn(m_string); \
m_string = nullptr; \
} \
} \
\
LPCWSTR Set(LPCWSTR str) { \
Release(); \
if (str) { \
m_string = MakeCoMemString(str); \
} \
return m_string; \
} \
LPCWSTR Get() { return m_string; } \
LPWSTR Copy() { \
if (m_string) \
return MakeCoMemString(m_string); \
return nullptr; \
} \
\
protected: \
LPWSTR MakeCoMemString(LPCWSTR source) { \
const size_t length = wcslen(source); \
const size_t bytes = (length + 1) * sizeof(*source); \
\
if (bytes <= length) { \
return nullptr; \
} \
\
wchar_t* result = reinterpret_cast<wchar_t*>(allocate_fn(bytes)); \
\
if (result) \
memcpy(result, source, bytes); \
return result; \
} \
LPWSTR m_string = nullptr; \
};
template <typename allocate_fn_t,
allocate_fn_t allocate_fn,
typename deallocate_fn_t,
deallocate_fn_t deallocate_fn>
class CoreWebView2CustomSchemeRegistrationBase
: public Microsoft::WRL::RuntimeClass<
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
ICoreWebView2CustomSchemeRegistration> {
public:
CoreWebView2CustomSchemeRegistrationBase(LPCWSTR schemeName) {
m_schemeName.Set(schemeName);
}
CoreWebView2CustomSchemeRegistrationBase(
CoreWebView2CustomSchemeRegistrationBase&&) = default;
~CoreWebView2CustomSchemeRegistrationBase() { ReleaseAllowedOrigins(); }
HRESULT STDMETHODCALLTYPE get_SchemeName(LPWSTR* schemeName) override {
if (!schemeName)
return E_POINTER;
*schemeName = m_schemeName.Copy();
if ((*schemeName == nullptr) && (m_schemeName.Get() != nullptr))
return HRESULT_FROM_WIN32(GetLastError());
return S_OK;
}
HRESULT STDMETHODCALLTYPE
GetAllowedOrigins(UINT32* allowedOriginsCount,
LPWSTR** allowedOrigins) override {
if (!allowedOrigins || !allowedOriginsCount) {
return E_POINTER;
}
*allowedOriginsCount = 0;
if (m_allowedOriginsCount == 0) {
*allowedOrigins = nullptr;
return S_OK;
} else {
*allowedOrigins = reinterpret_cast<LPWSTR*>(
allocate_fn(m_allowedOriginsCount * sizeof(LPWSTR)));
if (!(*allowedOrigins)) {
return HRESULT_FROM_WIN32(GetLastError());
}
ZeroMemory(*allowedOrigins, m_allowedOriginsCount * sizeof(LPWSTR));
for (UINT32 i = 0; i < m_allowedOriginsCount; i++) {
(*allowedOrigins)[i] = m_allowedOrigins[i].Copy();
if (!(*allowedOrigins)[i]) {
HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
for (UINT32 j = 0; j < i; j++) {
deallocate_fn((*allowedOrigins)[j]);
}
deallocate_fn(*allowedOrigins);
return hr;
}
}
*allowedOriginsCount = m_allowedOriginsCount;
return S_OK;
}
}
HRESULT STDMETHODCALLTYPE
SetAllowedOrigins(UINT32 allowedOriginsCount,
LPCWSTR* allowedOrigins) override {
ReleaseAllowedOrigins();
if (allowedOriginsCount == 0) {
return S_OK;
} else {
m_allowedOrigins = new AutoCoMemString[allowedOriginsCount];
if (!m_allowedOrigins) {
return HRESULT_FROM_WIN32(GetLastError());
}
for (UINT32 i = 0; i < allowedOriginsCount; i++) {
m_allowedOrigins[i].Set(allowedOrigins[i]);
if (!m_allowedOrigins[i].Get()) {
HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
for (UINT32 j = 0; j < i; j++) {
m_allowedOrigins[j].Release();
}
m_allowedOriginsCount = 0;
delete[] (m_allowedOrigins);
return hr;
}
}
m_allowedOriginsCount = allowedOriginsCount;
return S_OK;
}
}
protected:
DEFINE_AUTO_COMEM_STRING();
void ReleaseAllowedOrigins() {
if (m_allowedOrigins) {
delete[] (m_allowedOrigins);
m_allowedOrigins = nullptr;
}
}
AutoCoMemString m_schemeName;
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(TreatAsSecure, false);
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(HasAuthorityComponent, false);
AutoCoMemString* m_allowedOrigins = nullptr;
unsigned int m_allowedOriginsCount = 0;
};
// This is a base COM class that implements ICoreWebView2EnvironmentOptions.
template <typename allocate_fn_t,
allocate_fn_t allocate_fn,
typename deallocate_fn_t,
deallocate_fn_t deallocate_fn>
class CoreWebView2EnvironmentOptionsBase
: public Microsoft::WRL::Implements<
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
ICoreWebView2EnvironmentOptions,
ICoreWebView2EnvironmentOptions2,
ICoreWebView2EnvironmentOptions3,
ICoreWebView2EnvironmentOptions4,
ICoreWebView2EnvironmentOptions5,
ICoreWebView2EnvironmentOptions6,
ICoreWebView2EnvironmentOptions7,
ICoreWebView2EnvironmentOptions8> {
public:
static const COREWEBVIEW2_RELEASE_CHANNELS kInternalChannel =
static_cast<COREWEBVIEW2_RELEASE_CHANNELS>(1 << 4);
static const COREWEBVIEW2_RELEASE_CHANNELS kAllChannels =
COREWEBVIEW2_RELEASE_CHANNELS_STABLE |
COREWEBVIEW2_RELEASE_CHANNELS_BETA | COREWEBVIEW2_RELEASE_CHANNELS_DEV |
COREWEBVIEW2_RELEASE_CHANNELS_CANARY | kInternalChannel;
CoreWebView2EnvironmentOptionsBase() {
// Initialize the target compatible browser version value to the version
// of the browser binaries corresponding to this version of the SDK.
m_TargetCompatibleBrowserVersion.Set(CORE_WEBVIEW_TARGET_PRODUCT_VERSION);
}
// ICoreWebView2EnvironmentOptions7
HRESULT STDMETHODCALLTYPE
get_ReleaseChannels(COREWEBVIEW2_RELEASE_CHANNELS* channels) override {
if (!channels) {
return E_POINTER;
}
*channels = m_releaseChannels;
return S_OK;
}
HRESULT STDMETHODCALLTYPE
put_ReleaseChannels(COREWEBVIEW2_RELEASE_CHANNELS channels) override {
m_releaseChannels = channels;
return S_OK;
}
HRESULT STDMETHODCALLTYPE
get_ChannelSearchKind(COREWEBVIEW2_CHANNEL_SEARCH_KIND* value) override {
if (!value) {
return E_POINTER;
}
*value = m_channelSearchKind;
return S_OK;
}
HRESULT STDMETHODCALLTYPE
put_ChannelSearchKind(COREWEBVIEW2_CHANNEL_SEARCH_KIND value) override {
m_channelSearchKind = value;
return S_OK;
}
// ICoreWebView2EnvironmentOptions8
HRESULT STDMETHODCALLTYPE
get_ScrollBarStyle(COREWEBVIEW2_SCROLLBAR_STYLE* style) override {
if (!style) {
return E_POINTER;
}
*style = m_scrollbarStyle;
return S_OK;
}
HRESULT STDMETHODCALLTYPE
put_ScrollBarStyle(COREWEBVIEW2_SCROLLBAR_STYLE style) override {
m_scrollbarStyle = style;
return S_OK;
}
protected:
~CoreWebView2EnvironmentOptionsBase() { ReleaseCustomSchemeRegistrations(); };
void ReleaseCustomSchemeRegistrations() {
if (m_customSchemeRegistrations) {
for (UINT32 i = 0; i < m_customSchemeRegistrationsCount; i++) {
m_customSchemeRegistrations[i]->Release();
}
deallocate_fn(m_customSchemeRegistrations);
m_customSchemeRegistrations = nullptr;
m_customSchemeRegistrationsCount = 0;
}
}
private:
ICoreWebView2CustomSchemeRegistration** m_customSchemeRegistrations = nullptr;
unsigned int m_customSchemeRegistrationsCount = 0;
COREWEBVIEW2_RELEASE_CHANNELS m_releaseChannels = kAllChannels;
COREWEBVIEW2_CHANNEL_SEARCH_KIND m_channelSearchKind =
COREWEBVIEW2_CHANNEL_SEARCH_KIND_MOST_STABLE;
// ICoreWebView2EnvironmentOptions8
COREWEBVIEW2_SCROLLBAR_STYLE m_scrollbarStyle =
COREWEBVIEW2_SCROLLBAR_STYLE_DEFAULT;
DEFINE_AUTO_COMEM_STRING();
public:
// ICoreWebView2EnvironmentOptions
COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(AdditionalBrowserArguments)
COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(Language)
COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(TargetCompatibleBrowserVersion)
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(
AllowSingleSignOnUsingOSPrimaryAccount,
false)
// ICoreWebView2EnvironmentOptions2
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(ExclusiveUserDataFolderAccess,
false)
// ICoreWebView2EnvironmentOptions3
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(IsCustomCrashReportingEnabled,
false)
// ICoreWebView2EnvironmentOptions4
public:
HRESULT STDMETHODCALLTYPE GetCustomSchemeRegistrations(
UINT32* count,
ICoreWebView2CustomSchemeRegistration*** schemeRegistrations) override {
if (!count || !schemeRegistrations) {
return E_POINTER;
}
*count = 0;
if (m_customSchemeRegistrationsCount == 0) {
*schemeRegistrations = nullptr;
return S_OK;
} else {
*schemeRegistrations =
reinterpret_cast<ICoreWebView2CustomSchemeRegistration**>(
allocate_fn(sizeof(ICoreWebView2CustomSchemeRegistration*) *
m_customSchemeRegistrationsCount));
if (!*schemeRegistrations) {
return HRESULT_FROM_WIN32(GetLastError());
}
for (UINT32 i = 0; i < m_customSchemeRegistrationsCount; i++) {
(*schemeRegistrations)[i] = m_customSchemeRegistrations[i];
(*schemeRegistrations)[i]->AddRef();
}
*count = m_customSchemeRegistrationsCount;
return S_OK;
}
}
HRESULT STDMETHODCALLTYPE SetCustomSchemeRegistrations(
UINT32 count,
ICoreWebView2CustomSchemeRegistration** schemeRegistrations) override {
ReleaseCustomSchemeRegistrations();
m_customSchemeRegistrations =
reinterpret_cast<ICoreWebView2CustomSchemeRegistration**>(allocate_fn(
sizeof(ICoreWebView2CustomSchemeRegistration*) * count));
if (!m_customSchemeRegistrations) {
return GetLastError();
}
for (UINT32 i = 0; i < count; i++) {
m_customSchemeRegistrations[i] = schemeRegistrations[i];
m_customSchemeRegistrations[i]->AddRef();
}
m_customSchemeRegistrationsCount = count;
return S_OK;
}
// ICoreWebView2EnvironmentOptions5
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(EnableTrackingPrevention, true)
// ICoreWebView2EnvironmentOptions6
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(AreBrowserExtensionsEnabled,
false)
};
template <typename allocate_fn_t,
allocate_fn_t allocate_fn,
typename deallocate_fn_t,
deallocate_fn_t deallocate_fn>
class CoreWebView2EnvironmentOptionsBaseClass
: public Microsoft::WRL::RuntimeClass<
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
CoreWebView2EnvironmentOptionsBase<allocate_fn_t,
allocate_fn,
deallocate_fn_t,
deallocate_fn>> {
public:
CoreWebView2EnvironmentOptionsBaseClass() {}
protected:
~CoreWebView2EnvironmentOptionsBaseClass() override {}
};
typedef CoreWebView2CustomSchemeRegistrationBase<decltype(&::CoTaskMemAlloc),
::CoTaskMemAlloc,
decltype(&::CoTaskMemFree),
::CoTaskMemFree>
CoreWebView2CustomSchemeRegistration;
typedef CoreWebView2EnvironmentOptionsBaseClass<decltype(&::CoTaskMemAlloc),
::CoTaskMemAlloc,
decltype(&::CoTaskMemFree),
::CoTaskMemFree>
CoreWebView2EnvironmentOptions;
#endif // __core_webview2_environment_options_h__

View File

@@ -0,0 +1,253 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
***********************************************************************************************
Copyright (C) Microsoft Corporation. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
***********************************************************************************************
-->
<!-- This file contains the targets properties and such related to the wv2winrt tool.
It depends on the following from the importer:
* To guarantee that the wv2winrt tool is available at path ..\tools\wv2winrt\ (overridable via WV2WinRTPath, which must end with a single trailing slash `\`); or that WV2WinRTExe is defined with a valid path.
* To guarantee that Microsoft.Web.WebView2.winmd is referenced by the project when the tool is enabled (as defined by WebView2UseDispatchAdapter).
* To guarantee that, if defined, GeneratedFilesDir ends with a single trailing slash `\`; or to define WebView2DispatchAdapterOutputDir ending with a single trailing slash '\'.
-->
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Only do this for MSBuild versions below 16.0
as it is since done automatically, see https://github.com/microsoft/msbuild/pull/3605
-->
<MSBuildAllProjects Condition="'$(MSBuildToolsVersion)' &lt;= '15'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup>
<GeneratedFilesDir Condition="'$(GeneratedFilesDir)' == ''">$(IntDir)Generated Files\</GeneratedFilesDir>
<WV2WinRTVerbosity Condition="'$(WV2WinRTVerbosity)' == ''">normal</WV2WinRTVerbosity>
<WV2WinRTPath Condition="'$(WV2WinRTPath)' == ''">$(MSBuildThisFileDirectory)..\tools\wv2winrt\</WV2WinRTPath>
<WV2WinRTExe Condition="'$(WV2WinRTExe)' == ''">$(WV2WinRTPath)wv2winrt.exe</WV2WinRTExe>
<WV2WinRTWinMDInputsResponseFile Condition="'$(WV2WinRTWinMDInputsResponseFile)' == ''">$(IntDir)wv2winrt_inputs.rsp</WV2WinRTWinMDInputsResponseFile>
<WV2WinRTParametersResponseFile Condition="'$(WV2WinRTParametersResponseFile)' == ''">$(IntDir)wv2winrt_params.rsp</WV2WinRTParametersResponseFile>
<WV2WinRTSkipMakeProjections Condition="'$(WV2WinRTSkipMakeProjections)' == ''">false</WV2WinRTSkipMakeProjections>
<WV2WinRTRequireAllowForWebAttribute Condition="'$(WV2WinRTRequireAllowForWebAttribute)' == ''">false</WV2WinRTRequireAllowForWebAttribute>
<WV2WinRTIgnoreWebHostHiddenAttribute Condition="'$(WV2WinRTIgnoreWebHostHiddenAttribute)' == ''">false</WV2WinRTIgnoreWebHostHiddenAttribute>
<!-- If WebView2UseWinRT is enabled, we assume the generated classes are being used in this project and put them under wv2winrt default namespace. -->
<WebView2DispatchAdapterNamespace Condition="'$(WebView2DispatchAdapterNamespace)' == '' and '$(WebView2UseWinRT)' == 'true'">WinRTAdapter</WebView2DispatchAdapterNamespace>
<!-- Otherwise, we assume the project will be consumed from a separate project. We put generated code under RootNamespace in this case as that's the namespace that will be automatically available when the project is referenced. -->
<WebView2DispatchAdapterNamespace Condition="'$(WebView2DispatchAdapterNamespace)' == ''">$(RootNamespace)</WebView2DispatchAdapterNamespace>
<WebView2DispatchAdapterOutputDir Condition="'$(WebView2DispatchAdapterOutputDir)' == ''">$(GeneratedFilesDir)</WebView2DispatchAdapterOutputDir>
<WV2WinRTDisallowEmptyAdapter Condition="'$(WV2WinRTDisallowEmptyAdapter)' == ''">true</WV2WinRTDisallowEmptyAdapter>
<WebView2WinRTWrapSystemTypes Condition="'$(WebView2WinRTWrapSystemTypes)' == ''">true</WebView2WinRTWrapSystemTypes>
<WV2WinRTPlatformReferencesLevel Condition="'$(WV2WinRTPlatformReferencesLevel)' == ''">match</WV2WinRTPlatformReferencesLevel>
<!-- Note: Before* targets run before Compute* targets. -->
<BeforeMidlCompileTargets Condition="'$(WebView2UseDispatchAdapter)' == 'true'">
$(BeforeMidlCompileTargets);WV2WinRTAddDispatchAdapterIdl;
</BeforeMidlCompileTargets>
<BeforeClCompileTargets Condition="'$(WebView2UseDispatchAdapter)' == 'true'">
$(BeforeClCompileTargets);WV2WinRTAddGeneratedFiles;
</BeforeClCompileTargets>
</PropertyGroup>
<Target Name="GetWV2WinRTPlatformWinMDReferences"
DependsOnTargets="ResolveAssemblyReferences;CppWinRTImplicitlyExpandTargetPlatform;GetCppWinRTPlatformWinMDReferences;$(GetWV2WinRTPlatformWinMDReferencesDependsOn)"
Returns="@(WV2WinRTPlatformWinMDReferences)">
<ItemGroup>
<_WV2WinRTPlatformWinMDReferences Remove="@(_WV2WinRTPlatformWinMDReferences)"/>
<!-- Project platform references -->
<_WV2WinRTPlatformWinMDReferences Include="@(ReferencePath)" Condition="('$(WV2WinRTPlatformReferencesLevel)' == 'explicit' or '$(WV2WinRTPlatformReferencesLevel)' == 'foundation') and '%(ReferencePath.IsSystemReference)' == 'true' and '%(ReferencePath.WinMDFile)' == 'true' and '%(ReferencePath.ReferenceSourceTarget)' == 'ResolveAssemblyReference'"/>
<!-- Foundation contracts -->
<_WV2WinRTPlatformWinMDReferences Include="$(WindowsSDK_MetadataPathVersioned)\**\Windows.Foundation.FoundationContract.winmd" Condition="'$(WV2WinRTPlatformReferencesLevel)' == 'foundation'"/>
<_WV2WinRTPlatformWinMDReferences Include="$(WindowsSDK_MetadataPathVersioned)\**\Windows.Foundation.UniversalApiContract.winmd" Condition="'$(WV2WinRTPlatformReferencesLevel)' == 'foundation'"/>
<_WV2WinRTPlatformWinMDReferences Include="$(WindowsSDK_MetadataPathVersioned)\**\Windows.Networking.Connectivity.WwanContract.winmd" Condition="'$(WV2WinRTPlatformReferencesLevel)' == 'foundation'"/>
<!-- C++/WinRT -->
<_WV2WinRTPlatformWinMDReferences Include="@(CppWinRTPlatformWinMDReferences)" Condition="'$(WV2WinRTPlatformReferencesLevel)' == 'match'"/>
<WV2WinRTPlatformWinMDReferences Remove="@(WV2WinRTPlatformWinMDReferences)"/>
<WV2WinRTPlatformWinMDReferences Include="@(_WV2WinRTPlatformWinMDReferences->'%(FullPath)'->Distinct())"/>
</ItemGroup>
<Message Text="WV2WinRTPlatformWinMDReferences: &#xA;@(WV2WinRTPlatformWinMDReferences->'%(FullPath)', '&#xA;')" Importance="$(WV2WinRTVerbosity)"/>
</Target>
<Target Name="GetWV2WinRTDirectWinMDReferences"
DependsOnTargets="ResolveAssemblyReferences;GetCppWinRTDirectWinMDReferences;$(GetWV2WinRTDirectWinMDReferencesDependsOn)"
Returns="@(WV2WinRTDirectWinMDReferences)">
<ItemGroup>
<_WV2WinRTDirectWinMDReferences Remove="@(_WV2WinRTDirectWinMDReferences)"/>
<_WV2WinRTDirectWinMDReferences Include="@(CppWinRTDirectWinMDReferences)" Condition="'%(Filename)' != 'Microsoft.Web.WebView2.Core'"/>
<_WV2WinRTDirectWinMDReferences Include="@(CppWinRTDirectWinMDReferences)" Condition="'%(Filename)' == 'Microsoft.Web.WebView2.Core' And '$(WV2WinRTWrapWebViewTypes)' == 'true'"/>
<WV2WinRTDirectWinMDReferences Remove="@(WV2WinRTDirectWinMDReferences)"/>
<WV2WinRTDirectWinMDReferences Include="@(_WV2WinRTDirectWinMDReferences)"/>
</ItemGroup>
<Message Text="WV2WinRTDirectWinMDReferences: &#xA;@(WV2WinRTDirectWinMDReferences->'%(FullPath)', '&#xA;')" Importance="$(WV2WinRTVerbosity)"/>
</Target>
<Target Name="GetWV2WinRTProjectWinMDReferences"
DependsOnTargets="GetCppWinRTProjectWinMDReferences;$(GetWV2WinRTProjectWinMDReferencesDependsOn)"
Returns="@(WV2WinRTProjectWinMDReferences)">
<ItemGroup>
<_WV2WinRTStaticProjectWinMDReferences Remove="@(_WV2WinRTStaticProjectWinMDReferences)"/>
<_WV2WinRTStaticProjectWinMDReferences Include="@(CppWinRTStaticProjectWinMDReferences)"/>
<WV2WinRTStaticProjectWinMDReferences Remove="@(WV2WinRTStaticProjectWinMDReferences)"/>
<WV2WinRTStaticProjectWinMDReferences Include="@(_WV2WinRTStaticProjectWinMDReferences)"/>
</ItemGroup>
<ItemGroup>
<_WV2WinRTDynamicProjectWinMDReferences Remove="@(_WV2WinRTDynamicProjectWinMDReferences)"/>
<_WV2WinRTDynamicProjectWinMDReferences Include="@(CppWinRTDynamicProjectWinMDReferences)"/>
<WV2WinRTDynamicProjectWinMDReferences Remove="@(WV2WinRTDynamicProjectWinMDReferences)"/>
<WV2WinRTDynamicProjectWinMDReferences Include="@(_WV2WinRTDynamicProjectWinMDReferences)"/>
</ItemGroup>
<ItemGroup>
<WV2WinRTProjectWinMDReferences Remove="@(WV2WinRTProjectWinMDReferences)"/>
<WV2WinRTProjectWinMDReferences Include="@(WV2WinRTStaticProjectWinMDReferences)"/>
<WV2WinRTProjectWinMDReferences Include="@(WV2WinRTDynamicProjectWinMDReferences)"/>
</ItemGroup>
<Message Text="WV2WinRTStaticProjectWinMDReferences: &#xA;@(WV2WinRTStaticProjectWinMDReferences->'%(FullPath)', '&#xA;')" Condition="'$(WV2WinRTLogIntermediateWinMDReferences)' == 'true'" Importance="$(WV2WinRTVerbosity)"/>
<Message Text="WV2WinRTDynamicProjectWinMDReferences: &#xA;@(WV2WinRTDynamicProjectWinMDReferences->'%(FullPath)', '&#xA;')" Condition="'$(WV2WinRTLogIntermediateWinMDReferences)' == 'true'" Importance="$(WV2WinRTVerbosity)"/>
<Message Text="WV2WinRTProjectWinMDReferences: &#xA;@(WV2WinRTProjectWinMDReferences->'%(FullPath)', '&#xA;')" Importance="$(WV2WinRTVerbosity)"/>
</Target>
<Target Name="GetWV2WinRTAdditionalWinMDReferences"
DependsOnTargets="$(GetWV2WinRTAdditionalWinMDReferencesDependsOn)"
Returns="@(WV2WinRTAdditionalWinMDReferences)">
<ItemGroup>
<WebView2WinRTAdditionalWinMDReferences Include="$(WebView2WinRTAdditionalWinMDReferences)"/>
</ItemGroup>
<ItemGroup>
<_WV2WinRTAdditionalWinMDReferences Remove="@(_WV2WinRTAdditionalWinMDReferences)"/>
<_WV2WinRTAdditionalWinMDReferences Include="@(WebView2WinRTAdditionalWinMDReferences)"/>
<WV2WinRTAdditionalWinMDReferences Remove="@(WV2WinRTAdditionalWinMDReferences)"/>
<WV2WinRTAdditionalWinMDReferences Include="@(_WV2WinRTAdditionalWinMDReferences)"/>
</ItemGroup>
<Message Text="WV2WinRTAdditionalWinMDReferences: &#xA;@(WV2WinRTAdditionalWinMDReferences->'%(FullPath)', '&#xA;')" Importance="$(WV2WinRTVerbosity)"/>
</Target>
<Target Name="GetWV2WinRTInputs"
DependsOnTargets="GetWV2WinRTPlatformWinMDReferences;GetWV2WinRTDirectWinMDReferences;GetWV2WinRTProjectWinMDReferences;GetWV2WinRTAdditionalWinMDReferences;CppWinRTMakeComponentProjection"
Outputs="$(WV2WinRTWinMDInputsResponseFile)">
<ItemGroup>
<_WV2WinRTInputs Remove="@(_WV2WinRTInputs)"/>
<_WV2WinRTInputs Include="@(WV2WinRTDirectWinMDReferences)"/>
<_WV2WinRTInputs Include="@(WV2WinRTPlatformWinMDReferences)" Condition="'$(WebView2WinRTWrapSystemTypes)' == 'true'"/>
<_WV2WinRTInputs Include="@(WV2WinRTProjectWinMDReferences)"/>
<_WV2WinRTInputs Include="@(WV2WinRTAdditionalWinMDReferences)"/>
<_WV2WinRTInputs Include="@(_CppwinrtCompInputs)"/>
<WV2WinRTInputs Remove="@(WV2WinRTInputs)"/>
<WV2WinRTInputs Include="@(_WV2WinRTInputs->'%(FullPath)'->Distinct())" Condition="'%(_WV2WinRTInputs.WinMDFile)' == 'true' or ('%(_WV2WinRTInputs.WinMDFile)' == '' and '%(_WV2WinRTInputs.Extension)' == '.winmd')">
<WinMDPath>%(FullPath)</WinMDPath>
</WV2WinRTInputs>
</ItemGroup>
<Error Condition="'@(_WV2WinRTInputs)' == '' And '$(WV2WinRTDisallowEmptyAdapter)' == 'true'" Text="No winmd inputs for WebView2 WinRT Projection"/>
<!-- Always write the wv2winrt_inputs.rsp file when the target runs, because the file is used as the output of this target. -->
<WriteLinesToFile
File="$(WV2WinRTWinMDInputsResponseFile)" Lines="@(WV2WinRTInputs)"
ContinueOnError="true" Overwrite="true" />
<Message Text="WV2WinRTInputs: &#xA;@(WV2WinRTInputs->'%(WinMDPath)', '&#xA;')" Importance="$(WV2WinRTVerbosity)"/>
</Target>
<Target Name="WV2WinRTComputeIdlParameters">
<PropertyGroup>
<WV2WinRTIdlParameters>--idl</WV2WinRTIdlParameters>
<WV2WinRTIdlParameters Condition="'$(WebView2DispatchAdapterOutputDir)' != ''">$(WV2WinRTIdlParameters) --output-path &quot;$(WebView2DispatchAdapterOutputDir.TrimEnd('\'))&quot;</WV2WinRTIdlParameters>
<WV2WinRTIdlParameters Condition="'$(WebView2DispatchAdapterNamespace)' != ''">$(WV2WinRTIdlParameters) --output-namespace $(WebView2DispatchAdapterNamespace)</WV2WinRTIdlParameters>
</PropertyGroup>
</Target>
<Target Name="WV2WinRTGenerateDispatchAdapterIdl"
DependsOnTargets="WV2WinRTComputeIdlParameters"
Inputs="$(WV2WinRTExe)"
Outputs="$(WebView2DispatchAdapterOutputDir)wv2winrt\DispatchAdapter.idl">
<PropertyGroup>
<WV2WinRTIdlCommand Condition="'$(WV2WinRTCommandPrefix)' != ''">$(WV2WinRTCommandPrefix) </WV2WinRTIdlCommand>
<WV2WinRTIdlCommand>$(WV2WinRTIdlCommand)&quot;$(WV2WinRTExe)&quot; $(WV2WinRTIdlParameters)</WV2WinRTIdlCommand>
</PropertyGroup>
<Message Text="$(WV2WinRTIdlCommand)" Importance="$(WV2WinRTVerbosity)"/>
<Exec Command="$(WV2WinRTIdlCommand)"/>
</Target>
<Target Name="WV2WinRTAddDispatchAdapterIdl"
DependsOnTargets="WV2WinRTGenerateDispatchAdapterIdl">
<ItemGroup>
<Midl Include="$(WebView2DispatchAdapterOutputDir)wv2winrt\DispatchAdapter.idl" />
</ItemGroup>
</Target>
<Target Name="WV2WinRTComputeParameters"
DependsOnTargets="GetWV2WinRTInputs"
Inputs="$(WV2WinRTWinMDInputsResponseFile)"
Outputs="$(IntDir)wv2winrt.rsp">
<ItemGroup>
<WV2WinRTIncludeFilters Remove="@(WV2WinRTIncludeFilters)"/>
<WV2WinRTIncludeFilters Include="$(WebView2DispatchAdapterIncludeFilters)"/>
<WV2WinRTIncludeFilters Include="@(WebView2DispatchAdapterIncludeFilters)"/>
<WV2WinRTExcludeFilters Remove="@(WV2WinRTExcludeFilters)"/>
<WV2WinRTExcludeFilters Include="$(WebView2DispatchAdapterExcludeFilters)"/>
<WV2WinRTExcludeFilters Include="@(WebView2DispatchAdapterExcludeFilters)"/>
</ItemGroup>
<ItemGroup>
<_PCH Include="@(ClCompile->Metadata('PrecompiledHeaderFile')->Distinct())"/>
</ItemGroup>
<Error Condition="'@(_PCH->Count())' &gt; '1'" Text="wv2winrt only supports a single PCH."/>
<PropertyGroup>
<_PCH>@(_PCH->Distinct())</_PCH>
</PropertyGroup>
<PropertyGroup>
<WV2WinRTParameters Condition="'$(WebView2DispatchAdapterOutputDir)' != ''">--output-path &quot;$(WebView2DispatchAdapterOutputDir.TrimEnd('\'))&quot;</WV2WinRTParameters>
<WV2WinRTParameters Condition="'$(WebView2DispatchAdapterNamespace)' != ''">$(WV2WinRTParameters) --output-namespace $(WebView2DispatchAdapterNamespace)</WV2WinRTParameters>
<WV2WinRTParameters Condition="'$(WebView2DispatchAdapterNamespace)' != '$(RootNamespace)'">$(WV2WinRTParameters) --use-full-namespace</WV2WinRTParameters>
<WV2WinRTParameters Condition="'$(WebView2DispatchAdapterUseJavaScriptCase)' == 'true'">$(WV2WinRTParameters) --use-javascript-case</WV2WinRTParameters>
<WV2WinRTParameters Condition="'$(WV2WinRTExplicitIncludesOnly)' == 'true'">$(WV2WinRTParameters) --explicit-includes-only</WV2WinRTParameters>
<WV2WinRTParameters Condition="'$(WV2WinRTRequireAllowForWebAttribute)' == 'true'">$(WV2WinRTParameters) --require-allow-for-web-attribute</WV2WinRTParameters>
<WV2WinRTParameters Condition="'$(WV2WinRTIgnoreWebHostHiddenAttribute)' == 'true'">$(WV2WinRTParameters) --ignore-web-host-hidden-attribute</WV2WinRTParameters>
<WV2WinRTParameters Condition="'@(WV2WinRTIncludeFilters)' != ''">$(WV2WinRTParameters) --include @(WV2WinRTIncludeFilters, ' ')</WV2WinRTParameters>
<WV2WinRTParameters Condition="'@(WV2WinRTExcludeFilters)' != ''">$(WV2WinRTParameters) --exclude @(WV2WinRTExcludeFilters, ' ')</WV2WinRTParameters>
<WV2WinRTParameters Condition="'@(WV2WinRTInputs)' != ''">$(WV2WinRTParameters) --winmd-paths @(WV2WinRTInputs->'&quot;%(WinMDPath)&quot;', ' ')</WV2WinRTParameters>
<WV2WinRTParameters Condition="'$(WV2WinRTVerbosity)' == 'high'">$(WV2WinRTParameters) --verbose</WV2WinRTParameters>
<WV2WinRTParameters Condition="'$(_PCH)' != ''">$(WV2WinRTParameters) --pch &quot;$(_PCH)&quot;</WV2WinRTParameters>
<WV2WinRTParameters Condition="'$(WV2WinRTAdditionalParameters)' != ''">$(WV2WinRTParameters) $(WV2WinRTAdditionalParameters)</WV2WinRTParameters>
</PropertyGroup>
<!-- Always write the wv2winrt.rsp file when the target runs, because the file is used as the output of this target. -->
<WriteLinesToFile
File="$(IntDir)wv2winrt.rsp" Lines="$(WV2WinRTParameters)"
ContinueOnError="true" Overwrite="true" />
</Target>
<Target Name="WV2WinRTMakeProjections"
Condition="'$(WV2WinRTSkipMakeProjections)' != 'true'"
DependsOnTargets="WV2WinRTComputeParameters"
Inputs="$(IntDir)wv2winrt.rsp"
Outputs="$(WebView2DispatchAdapterOutputDir)wv2winrt\**">
<PropertyGroup>
<WV2WinRTCommand Condition="'$(WV2WinRTCommandPrefix)' != ''">$(WV2WinRTCommandPrefix) </WV2WinRTCommand>
<WV2WinRTCommand>$(WV2WinRTCommand)&quot;$(WV2WinRTExe)&quot; $(WV2WinRTParameters)</WV2WinRTCommand>
</PropertyGroup>
<Message Text="$(WV2WinRTCommand)" Importance="$(WV2WinRTVerbosity)"/>
<Exec Command="$(WV2WinRTCommand)" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="WV2WinRTOutput"/>
</Exec>
</Target>
<Target Name="WV2WinRTAddGeneratedFiles"
DependsOnTargets="WV2WinRTMakeProjections">
<ItemGroup>
<_WV2WinRTFilesToBuild Remove="@(_WV2WinRTFilesToBuild)"/>
<_WV2WinRTFilesToBuild Include="$(WebView2DispatchAdapterOutputDir)wv2winrt\*.cpp"/>
<_WV2WinRTFilesToClean Include="$(WebView2DispatchAdapterOutputDir)wv2winrt\*.*"/>
</ItemGroup>
<ItemGroup>
<ClCompile Include="@(_WV2WinRTFilesToBuild)">
<ObjectFileName>$(IntDir)wv2winrt\</ObjectFileName>
</ClCompile>
<FileWrites Include="@(_WV2WinRTFilesToClean)" Condition="'$(WV2WinRTSkipMakeProjections)' != 'true'"/>
</ItemGroup>
<Message Text="GeneratedCppFiles: &#xA;@(_WV2WinRTFilesToBuild, '&#xA;')" Importance="$(WV2WinRTVerbosity)" />
</Target>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(WebView2DispatchAdapterOutputDir)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,504 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Microsoft.Web.WebView2.WinForms</name>
</assembly>
<members>
<member name="T:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties">
<summary>
This class is a bundle of the most common parameters used to create <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> and <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Controller"/> instances.
Its main purpose is to be set to <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> in order to customize the environment and/or controller used by a <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/> during implicit initialization.
</summary>
<remarks>
This class isn't intended to contain all possible environment or controller customization options.
If you need complete control over the environment and/or controller used by a WebView2 control then you'll need to initialize the control explicitly by
creating your own environment (with <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/>) and/or controller options (with <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2ControllerOptions"/>) and passing them to <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/>
*before* you set the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property to anything.
See the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/> class documentation for an initialization overview.
</remarks>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.#ctor">
<summary>
Creates a new instance of <see cref="T:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties"/> with default data for all properties.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.BrowserExecutableFolder">
<summary>
Gets or sets the value to pass as the browserExecutableFolder parameter of <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.UserDataFolder">
<summary>
Gets or sets the value to pass as the userDataFolder parameter of <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.Language">
<summary>
Gets or sets the value to use for the Language property of the CoreWebView2EnvironmentOptions parameter passed to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.ProfileName">
<summary>
Gets or sets the value to use for the ProfileName property of the CoreWebView2ControllerOptions parameter passed to CreateCoreWebView2ControllerWithOptionsAsync when creating an controller with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.AdditionalBrowserArguments">
<summary>
Gets or sets the value to pass as the AdditionalBrowserArguments parameter of <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions"/> which is passed to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.IsInPrivateModeEnabled">
<summary>
Gets or sets the value to use for the IsInPrivateModeEnabled property of the CoreWebView2ControllerOptions parameter passed to CreateCoreWebView2ControllerWithOptionsAsync when creating an controller with this instance.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.CreateEnvironmentAsync">
<summary>
Create a <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> using the current values of this instance's properties.
</summary>
<returns>A task which will provide the created environment on completion, or null if no environment-related options are set.</returns>
<remarks>
As long as no other properties on this instance are changed, repeated calls to this method will return the same task/environment as earlier calls.
If some other property is changed then the next call to this method will return a different task/environment.
</remarks>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.CreateCoreWebView2ControllerOptions(Microsoft.Web.WebView2.Core.CoreWebView2Environment)">
<summary>
Creates a <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions"/> using the current values of this instance's properties.
</summary>
<returns>A <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions"/> object or null if no controller-related properties are set.</returns>
<exception cref="T:System.NullReferenceException">Thrown if the parameter environment is null.</exception>
</member>
<member name="T:Microsoft.Web.WebView2.WinForms.WebView2">
<summary>
Control to embed WebView2 in WinForms.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.#ctor">
<summary>
Create a new WebView2 WinForms control.
After construction the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property is <c>null</c>.
Call <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> to initialize the underlying <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2"/>.
</summary>
<remarks>
This control is effectively a wrapper around the WebView2 COM API, which you can find documentation for here: https://aka.ms/webview2
You can directly access the underlying ICoreWebView2 interface and all of its functionality by accessing the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property.
Some of the most common COM functionality is also accessible directly through wrapper methods/properties/events on the control.
Upon creation, the control's CoreWebView2 property will be null.
This is because creating the CoreWebView2 is an expensive operation which involves things like launching Edge browser processes.
There are two ways to cause the CoreWebView2 to be created:
1) Call the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> method. This is referred to as explicit initialization.
2) Set the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property. This is referred to as implicit initialization.
Either option will start initialization in the background and return back to the caller without waiting for it to finish.
To specify options regarding the initialization process, either pass your own <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> to EnsureCoreWebView2Async or set the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> property prior to initialization.
When initialization has finished (regardless of how it was triggered) then the following things will occur, in this order:
1) The control's <see cref="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted"/> event will be invoked. If you need to perform one time setup operations on the CoreWebView2 prior to its use then you should do so in a handler for that event.
2) If a Uri has been set to the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property then the control will start navigating to it in the background (i.e. these steps will continue without waiting for the navigation to finish).
3) The Task returned from <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> will complete.
For more details about any of the methods/properties/events involved in the initialization process, see its specific documentation.
Accelerator key presses (e.g. Ctrl+P) that occur within the control will
fire standard key press events such as OnKeyDown. You can suppress the
control's default implementation of an accelerator key press (e.g.
printing, in the case of Ctrl+P) by setting the Handled property of its
EventArgs to true. Also note that the underlying browser process is
blocked while these handlers execute, so:
<list type="number">
<item>
You should avoid doing a lot of work in these handlers.
</item>
<item>
Some of the WebView2 and CoreWebView2 APIs may throw errors if
invoked within these handlers due to being unable to communicate with
the browser process.
</item>
</list>
If you need to do a lot of work and/or invoke WebView2 APIs in response to
accelerator keys then consider kicking off a background task or queuing
the work for later execution on the UI thread.
</remarks>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Dispose(System.Boolean)">
<summary>
Cleans up any resources being used.
</summary>
<param name="disposing"><c>true</c> if managed resources should be disposed; otherwise, <c>false</c>.</param>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnPaint(System.Windows.Forms.PaintEventArgs)">
<summary>
Overrides the base OnPaint event to have custom actions
in designer mode
</summary>
<param name="e">The graphics devices which is the source</param>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.WndProc(System.Windows.Forms.Message@)">
<summary>
Overrides the base WndProc events to handle specific window messages.
</summary>
<param name="m">The Message object containing the HWND window message and parameters</param>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties">
<summary>
Gets or sets a bag of options which are used during initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
This property cannot be modified (an exception will be thrown) after initialization of the control's CoreWebView2 has started.
</summary>
<exception cref="T:System.InvalidOperationException">Thrown if initialization of the control's CoreWebView2 has already started.</exception>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)">
<summary>
Explicitly trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
</summary>
<param name="environment">
A pre-created <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> that should be used to create the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
Creating your own environment gives you control over several options that affect how the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is initialized.
If you pass <c>null</c> (the default value) then a default environment will be created and used automatically.
</param>
<param name="controllerOptions">
A pre-created <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions"/> that should be used to create the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2"/>.
Creating your own controller options gives you control over several options that affect how the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2"/> is initialized.
If you pass a controllerOptions to this method then it will override any settings specified on the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> property.
If you pass <c>null</c> (the default value) and no value has been set to <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> then a default controllerOptions will be created and used automatically.
</param>
<returns>
A Task that represents the background initialization process.
When the task completes then the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property will be available for use (i.e. non-null).
Note that the control's <see cref="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted"/> event will be invoked before the task completes
or on exceptions.
</returns>
<remarks>
Unless previous initialization has already failed, calling this method additional times with the same parameter will have no effect (any specified environment is ignored) and return the same Task as the first call.
Unless previous initialization has already failed, calling this method after initialization has been implicitly triggered by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property will have no effect if no environment is given
and simply return a Task representing that initialization already in progress.
Unless previous initialization has already failed, calling this method with a different environment after initialization has begun will result in an <see cref="T:System.ArgumentException"/>. For example, this can happen if you begin initialization
by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property and then call this method with a new environment, if you begin initialization with <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> and then call this method with a new
environment, or if you begin initialization with one environment and then call this method with no environment specified.
When this method is called after previous initialization has failed, it will trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> again.
Note that even though this method is asynchronous and returns a Task, it still must be called on the UI thread like most public functionality of most UI controls.
<para>
The following summarizes the possible error values and a description of why these errors occur.
<list type="table">
<listheader>
<description>Error Value</description>
<description>Description</description>
</listheader>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)</c></description>
<description>*\\Edge\\Application* path used in browserExecutableFolder.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_INVALID_STATE)</c></description>
<description>Specified options do not match the options of the WebViews that are currently running in the shared browser process.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_INVALID_WINDOW_HANDLE)</c></description>
<description>WebView2 Initialization failed due to an invalid host HWND parentWindow.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_DISK_FULL)</c></description>
<description>WebView2 Initialization failed due to reaching the maximum number of installed runtime versions.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_PRODUCT_UNINSTALLED</c></description>
<description>If the Webview depends upon an installed WebView2 Runtime version and it is uninstalled.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)</c></description>
<description>Could not find Edge installation.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_FILE_EXISTS)</c></description>
<description>User data folder cannot be created because a file with the same name already exists.</description>
</item>
<item>
<description><c>E_ACCESSDENIED</c></description>
<description>Unable to create user data folder, Access Denied.</description>
</item>
<item>
<description><c>E_FAIL</c></description>
<description>Edge runtime unable to start.</description>
</item>
</list>
</para>
</remarks>
<exception cref="T:System.ArgumentException">
Thrown if this method is called with a different environment than when it was initialized. See Remarks for more info.
</exception>
<exception cref="T:System.InvalidOperationException">
Thrown if this instance of <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is already disposed, or if the calling thread isn't the thread which created this object (usually the UI thread). See <see cref="P:System.Windows.Forms.Control.InvokeRequired"/> for more info.
May also be thrown if the browser process has crashed unexpectedly and left the control in an invalid state. We are considering throwing a different type of exception for this case in the future.
</exception>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment)">
<summary>
Explicitly trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
</summary>
<param name="environment">
A pre-created <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> that should be used to create the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
Creating your own environment gives you control over several options that affect how the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is initialized.
If you pass <c>null</c> then a default environment will be created and used automatically.
</param>
<returns>
A Task that represents the background initialization process.
When the task completes then the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property will be available for use (i.e. non-null).
Note that the control's <see cref="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted"/> event will be invoked before the task completes
or on exceptions.
</returns>
<remarks>
Unless previous initialization has already failed, calling this method additional times with the same parameter will have no effect (any specified environment is ignored) and return the same Task as the first call.
Unless previous initialization has already failed, calling this method after initialization has been implicitly triggered by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property will have no effect if no environment is given
and simply return a Task representing that initialization already in progress.
Unless previous initialization has already failed, calling this method with a different environment after initialization has begun will result in an <see cref="T:System.ArgumentException"/>. For example, this can happen if you begin initialization
by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property and then call this method with a new environment, if you begin initialization with <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> and then call this method with a new
environment, or if you begin initialization with one environment and then call this method with no environment specified.
When this method is called after previous initialization has failed, it will trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> again.
Note that even though this method is asynchronous and returns a Task, it still must be called on the UI thread like most public functionality of most UI controls.
</remarks>
<exception cref="T:System.ArgumentException">
Thrown if this method is called with a different environment than when it was initialized. See Remarks for more info.
</exception>
<exception cref="T:System.InvalidOperationException">
Thrown if this instance of <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is already disposed, or if the calling thread isn't the thread which created this object (usually the UI thread). See <see cref="P:System.Windows.Forms.Control.InvokeRequired"/> for more info.
May also be thrown if the browser process has crashed unexpectedly and left the control in an invalid state. We are considering throwing a different type of exception for this case in the future.
</exception>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.InitCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)">
<summary>
This is the private function which implements the actual background initialization task.
Cannot be called if the control is already initialized or has been disposed.
</summary>
<param name="environment">
The environment to use to create the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Controller"/>.
If that is null then a default environment is created with <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> and its default parameters.
</param>
<param name="controllerOptions">
The controllerOptions to use to create the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Controller"/>.
If that is null then a default controllerOptions is created with its default parameters.
</param>
<returns>A task representing the background initialization process.</returns>
<remarks>All the event handlers added here need to be removed in <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.Dispose(System.Boolean)"/>.</remarks>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CreateParams">
<summary>
Protected CreateParams property. Used to set custom window styles to the forms HWND.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnVisibleChanged(System.EventArgs)">
<summary>
Protected VisibilityChanged handler.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnSizeChanged(System.EventArgs)">
<summary>
Protected SizeChanged handler.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Select(System.Boolean,System.Boolean)">
<summary>
Protected Select method: override this to capture tab direction when WebView control is activated
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnGotFocus(System.EventArgs)">
<summary>
Protected OnGotFocus handler.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnParentChanged(System.EventArgs)">
<summary>
Protected OnParentChanged handler.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.IsInitialized">
<summary>
True if initialization finished successfully and the control is not disposed yet.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.GetSitedParentSite(System.Windows.Forms.Control)">
<summary>
Recursive retrieval of the parent control
</summary>
<param name="control">The control to get the parent for</param>
<returns>The root parent control</returns>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2">
<summary>
The underlying CoreWebView2. Use this property to perform more operations on the WebView2 content than is exposed
on the WebView2. This value is null until it is initialized and the object itself has undefined behaviour once the control is disposed.
You can force the underlying CoreWebView2 to
initialize via the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> method.
</summary>
<exception cref="T:System.InvalidOperationException">Thrown if the calling thread isn't the thread which created this object (usually the UI thread). See <see cref="P:System.Windows.Forms.Control.InvokeRequired"/> for more info.</exception>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.ZoomFactor">
<summary>
The zoom factor for the WebView.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.AllowExternalDrop">
<summary>
Enable/disable external drop.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.Source">
<summary>
The Source property is the URI of the top level document of the
WebView2. Setting the Source is equivalent to calling <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Navigate(System.String)"/>.
Setting the Source will trigger initialization of the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>, if not already initialized.
The default value of Source is <c>null</c>, indicating that the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.
</summary>
<exception cref="T:System.ArgumentException">Specified value is not an absolute <see cref="T:System.Uri"/>.</exception>
<exception cref="T:System.NotImplementedException">Specified value is <c>null</c> and the control is initialized.</exception>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Navigate(System.String)"/>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CanGoForward">
<summary>
Returns true if the webview can navigate to a next page in the
navigation history via the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.GoForward"/> method.
This is equivalent to the <see cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoForward"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this property is <c>false</c>.
</summary>
<seealso cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoForward"/>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CanGoBack">
<summary>
Returns <c>true</c> if the webview can navigate to a previous page in the
navigation history via the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.GoBack"/> method.
This is equivalent to the <see cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoBack"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this property is <c>false</c>.
</summary>
<seealso cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoBack"/>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.DefaultBackgroundColor">
<summary>
The default background color for the WebView.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.ExecuteScriptAsync(System.String)">
<summary>
Executes the provided script in the top level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.ExecuteScriptAsync(System.String)"/>.
</summary>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.</exception>
<exception cref="T:System.InvalidOperationException">Thrown when browser process has unexpectedly and left this control in an invalid state. We are considering throwing a different type of exception for this case in the future.</exception>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.ExecuteScriptAsync(System.String)"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Reload">
<summary>
Reloads the top level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Reload"/>.
</summary>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.</exception>
<exception cref="T:System.InvalidOperationException">Thrown when browser process has unexpectedly and left this control in an invalid state. We are considering throwing a different type of exception for this case in the future.</exception>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Reload"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.GoForward">
<summary>
Navigates to the next page in navigation history.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoForward"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this method does nothing.
</summary>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoForward"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.GoBack">
<summary>
Navigates to the previous page in navigation history.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoBack"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this method does nothing.
</summary>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoBack"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.NavigateToString(System.String)">
<summary>
Renders the provided HTML as the top level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.NavigateToString(System.String)"/>.
</summary>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.</exception>
<exception cref="T:System.InvalidOperationException">Thrown when browser process has unexpectedly and left this control in an invalid state. We are considering throwing a different type of exception for this case in the future.</exception>
<remarks>The <c>htmlContent</c> parameter may not be larger than 2 MB (2 * 1024 * 1024 bytes) in total size. The origin of the new page is <c>about:blank</c>.</remarks>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.NavigateToString(System.String)"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Stop">
<summary>
Stops any in progress navigation in the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Stop"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this method does nothing.
</summary>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Stop"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted">
<summary>
This event is triggered either 1) when the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> has finished being initialized (regardless of how it was triggered or whether it succeeded) but before it is used for anything
OR 2) the initialization failed.
You should handle this event if you need to perform one time setup operations on the CoreWebView2 which you want to affect all of its usages
(e.g. adding event handlers, configuring settings, installing document creation scripts, adding host objects).
</summary>
<remarks>
This sender will be the WebView2 control, whose CoreWebView2 property will now be valid (i.e. non-null) for the first time
if <see cref="P:Microsoft.Web.WebView2.Core.CoreWebView2InitializationCompletedEventArgs.IsSuccess"/> is true.
Unlikely this event can fire second time (after reporting initialization success first)
if the initialization is followed by navigation which fails.
</remarks>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.NavigationStarting">
<summary>
NavigationStarting dispatches before a new navigate starts for the top
level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationStarting"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationStarting"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.NavigationCompleted">
<summary>
NavigationCompleted dispatches after a navigate of the top level
document completes rendering either successfully or not.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationCompleted"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationCompleted"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.WebMessageReceived">
<summary>
WebMessageReceived dispatches after web content sends a message to the
app host via <c>chrome.webview.postMessage</c>.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.WebMessageReceived"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.WebMessageReceived"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.SourceChanged">
<summary>
SourceChanged dispatches after the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property changes. This may happen
during a navigation or if otherwise the script in the page changes the
URI of the document.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.SourceChanged"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.SourceChanged"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.ContentLoading">
<summary>
ContentLoading dispatches after a navigation begins to a new URI and the
content of that URI begins to render.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.ContentLoading"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.ContentLoading"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.ZoomFactorChanged">
<summary>
ZoomFactorChanged dispatches when the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.ZoomFactor"/> property changes.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2Controller.ZoomFactorChanged"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2Controller.ZoomFactorChanged"/>
</member>
<member name="F:Microsoft.Web.WebView2.WinForms.WebView2.components">
<summary>
Required designer variable.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.InitializeComponent">
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
</member>
</members>
</doc>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,504 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Microsoft.Web.WebView2.WinForms</name>
</assembly>
<members>
<member name="T:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties">
<summary>
This class is a bundle of the most common parameters used to create <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> and <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Controller"/> instances.
Its main purpose is to be set to <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> in order to customize the environment and/or controller used by a <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/> during implicit initialization.
</summary>
<remarks>
This class isn't intended to contain all possible environment or controller customization options.
If you need complete control over the environment and/or controller used by a WebView2 control then you'll need to initialize the control explicitly by
creating your own environment (with <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/>) and/or controller options (with <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2ControllerOptions"/>) and passing them to <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/>
*before* you set the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property to anything.
See the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/> class documentation for an initialization overview.
</remarks>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.#ctor">
<summary>
Creates a new instance of <see cref="T:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties"/> with default data for all properties.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.BrowserExecutableFolder">
<summary>
Gets or sets the value to pass as the browserExecutableFolder parameter of <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.UserDataFolder">
<summary>
Gets or sets the value to pass as the userDataFolder parameter of <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.Language">
<summary>
Gets or sets the value to use for the Language property of the CoreWebView2EnvironmentOptions parameter passed to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.ProfileName">
<summary>
Gets or sets the value to use for the ProfileName property of the CoreWebView2ControllerOptions parameter passed to CreateCoreWebView2ControllerWithOptionsAsync when creating an controller with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.AdditionalBrowserArguments">
<summary>
Gets or sets the value to pass as the AdditionalBrowserArguments parameter of <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions"/> which is passed to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.IsInPrivateModeEnabled">
<summary>
Gets or sets the value to use for the IsInPrivateModeEnabled property of the CoreWebView2ControllerOptions parameter passed to CreateCoreWebView2ControllerWithOptionsAsync when creating an controller with this instance.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.CreateEnvironmentAsync">
<summary>
Create a <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> using the current values of this instance's properties.
</summary>
<returns>A task which will provide the created environment on completion, or null if no environment-related options are set.</returns>
<remarks>
As long as no other properties on this instance are changed, repeated calls to this method will return the same task/environment as earlier calls.
If some other property is changed then the next call to this method will return a different task/environment.
</remarks>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.CreateCoreWebView2ControllerOptions(Microsoft.Web.WebView2.Core.CoreWebView2Environment)">
<summary>
Creates a <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions"/> using the current values of this instance's properties.
</summary>
<returns>A <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions"/> object or null if no controller-related properties are set.</returns>
<exception cref="T:System.NullReferenceException">Thrown if the parameter environment is null.</exception>
</member>
<member name="T:Microsoft.Web.WebView2.WinForms.WebView2">
<summary>
Control to embed WebView2 in WinForms.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.#ctor">
<summary>
Create a new WebView2 WinForms control.
After construction the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property is <c>null</c>.
Call <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> to initialize the underlying <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2"/>.
</summary>
<remarks>
This control is effectively a wrapper around the WebView2 COM API, which you can find documentation for here: https://aka.ms/webview2
You can directly access the underlying ICoreWebView2 interface and all of its functionality by accessing the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property.
Some of the most common COM functionality is also accessible directly through wrapper methods/properties/events on the control.
Upon creation, the control's CoreWebView2 property will be null.
This is because creating the CoreWebView2 is an expensive operation which involves things like launching Edge browser processes.
There are two ways to cause the CoreWebView2 to be created:
1) Call the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> method. This is referred to as explicit initialization.
2) Set the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property. This is referred to as implicit initialization.
Either option will start initialization in the background and return back to the caller without waiting for it to finish.
To specify options regarding the initialization process, either pass your own <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> to EnsureCoreWebView2Async or set the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> property prior to initialization.
When initialization has finished (regardless of how it was triggered) then the following things will occur, in this order:
1) The control's <see cref="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted"/> event will be invoked. If you need to perform one time setup operations on the CoreWebView2 prior to its use then you should do so in a handler for that event.
2) If a Uri has been set to the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property then the control will start navigating to it in the background (i.e. these steps will continue without waiting for the navigation to finish).
3) The Task returned from <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> will complete.
For more details about any of the methods/properties/events involved in the initialization process, see its specific documentation.
Accelerator key presses (e.g. Ctrl+P) that occur within the control will
fire standard key press events such as OnKeyDown. You can suppress the
control's default implementation of an accelerator key press (e.g.
printing, in the case of Ctrl+P) by setting the Handled property of its
EventArgs to true. Also note that the underlying browser process is
blocked while these handlers execute, so:
<list type="number">
<item>
You should avoid doing a lot of work in these handlers.
</item>
<item>
Some of the WebView2 and CoreWebView2 APIs may throw errors if
invoked within these handlers due to being unable to communicate with
the browser process.
</item>
</list>
If you need to do a lot of work and/or invoke WebView2 APIs in response to
accelerator keys then consider kicking off a background task or queuing
the work for later execution on the UI thread.
</remarks>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Dispose(System.Boolean)">
<summary>
Cleans up any resources being used.
</summary>
<param name="disposing"><c>true</c> if managed resources should be disposed; otherwise, <c>false</c>.</param>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnPaint(System.Windows.Forms.PaintEventArgs)">
<summary>
Overrides the base OnPaint event to have custom actions
in designer mode
</summary>
<param name="e">The graphics devices which is the source</param>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.WndProc(System.Windows.Forms.Message@)">
<summary>
Overrides the base WndProc events to handle specific window messages.
</summary>
<param name="m">The Message object containing the HWND window message and parameters</param>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties">
<summary>
Gets or sets a bag of options which are used during initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
This property cannot be modified (an exception will be thrown) after initialization of the control's CoreWebView2 has started.
</summary>
<exception cref="T:System.InvalidOperationException">Thrown if initialization of the control's CoreWebView2 has already started.</exception>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)">
<summary>
Explicitly trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
</summary>
<param name="environment">
A pre-created <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> that should be used to create the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
Creating your own environment gives you control over several options that affect how the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is initialized.
If you pass <c>null</c> (the default value) then a default environment will be created and used automatically.
</param>
<param name="controllerOptions">
A pre-created <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions"/> that should be used to create the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2"/>.
Creating your own controller options gives you control over several options that affect how the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2"/> is initialized.
If you pass a controllerOptions to this method then it will override any settings specified on the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> property.
If you pass <c>null</c> (the default value) and no value has been set to <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> then a default controllerOptions will be created and used automatically.
</param>
<returns>
A Task that represents the background initialization process.
When the task completes then the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property will be available for use (i.e. non-null).
Note that the control's <see cref="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted"/> event will be invoked before the task completes
or on exceptions.
</returns>
<remarks>
Unless previous initialization has already failed, calling this method additional times with the same parameter will have no effect (any specified environment is ignored) and return the same Task as the first call.
Unless previous initialization has already failed, calling this method after initialization has been implicitly triggered by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property will have no effect if no environment is given
and simply return a Task representing that initialization already in progress.
Unless previous initialization has already failed, calling this method with a different environment after initialization has begun will result in an <see cref="T:System.ArgumentException"/>. For example, this can happen if you begin initialization
by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property and then call this method with a new environment, if you begin initialization with <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> and then call this method with a new
environment, or if you begin initialization with one environment and then call this method with no environment specified.
When this method is called after previous initialization has failed, it will trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> again.
Note that even though this method is asynchronous and returns a Task, it still must be called on the UI thread like most public functionality of most UI controls.
<para>
The following summarizes the possible error values and a description of why these errors occur.
<list type="table">
<listheader>
<description>Error Value</description>
<description>Description</description>
</listheader>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)</c></description>
<description>*\\Edge\\Application* path used in browserExecutableFolder.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_INVALID_STATE)</c></description>
<description>Specified options do not match the options of the WebViews that are currently running in the shared browser process.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_INVALID_WINDOW_HANDLE)</c></description>
<description>WebView2 Initialization failed due to an invalid host HWND parentWindow.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_DISK_FULL)</c></description>
<description>WebView2 Initialization failed due to reaching the maximum number of installed runtime versions.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_PRODUCT_UNINSTALLED</c></description>
<description>If the Webview depends upon an installed WebView2 Runtime version and it is uninstalled.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)</c></description>
<description>Could not find Edge installation.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_FILE_EXISTS)</c></description>
<description>User data folder cannot be created because a file with the same name already exists.</description>
</item>
<item>
<description><c>E_ACCESSDENIED</c></description>
<description>Unable to create user data folder, Access Denied.</description>
</item>
<item>
<description><c>E_FAIL</c></description>
<description>Edge runtime unable to start.</description>
</item>
</list>
</para>
</remarks>
<exception cref="T:System.ArgumentException">
Thrown if this method is called with a different environment than when it was initialized. See Remarks for more info.
</exception>
<exception cref="T:System.InvalidOperationException">
Thrown if this instance of <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is already disposed, or if the calling thread isn't the thread which created this object (usually the UI thread). See <see cref="P:System.Windows.Forms.Control.InvokeRequired"/> for more info.
May also be thrown if the browser process has crashed unexpectedly and left the control in an invalid state. We are considering throwing a different type of exception for this case in the future.
</exception>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment)">
<summary>
Explicitly trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
</summary>
<param name="environment">
A pre-created <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> that should be used to create the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
Creating your own environment gives you control over several options that affect how the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is initialized.
If you pass <c>null</c> then a default environment will be created and used automatically.
</param>
<returns>
A Task that represents the background initialization process.
When the task completes then the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property will be available for use (i.e. non-null).
Note that the control's <see cref="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted"/> event will be invoked before the task completes
or on exceptions.
</returns>
<remarks>
Unless previous initialization has already failed, calling this method additional times with the same parameter will have no effect (any specified environment is ignored) and return the same Task as the first call.
Unless previous initialization has already failed, calling this method after initialization has been implicitly triggered by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property will have no effect if no environment is given
and simply return a Task representing that initialization already in progress.
Unless previous initialization has already failed, calling this method with a different environment after initialization has begun will result in an <see cref="T:System.ArgumentException"/>. For example, this can happen if you begin initialization
by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property and then call this method with a new environment, if you begin initialization with <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> and then call this method with a new
environment, or if you begin initialization with one environment and then call this method with no environment specified.
When this method is called after previous initialization has failed, it will trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> again.
Note that even though this method is asynchronous and returns a Task, it still must be called on the UI thread like most public functionality of most UI controls.
</remarks>
<exception cref="T:System.ArgumentException">
Thrown if this method is called with a different environment than when it was initialized. See Remarks for more info.
</exception>
<exception cref="T:System.InvalidOperationException">
Thrown if this instance of <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is already disposed, or if the calling thread isn't the thread which created this object (usually the UI thread). See <see cref="P:System.Windows.Forms.Control.InvokeRequired"/> for more info.
May also be thrown if the browser process has crashed unexpectedly and left the control in an invalid state. We are considering throwing a different type of exception for this case in the future.
</exception>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.InitCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)">
<summary>
This is the private function which implements the actual background initialization task.
Cannot be called if the control is already initialized or has been disposed.
</summary>
<param name="environment">
The environment to use to create the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Controller"/>.
If that is null then a default environment is created with <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> and its default parameters.
</param>
<param name="controllerOptions">
The controllerOptions to use to create the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Controller"/>.
If that is null then a default controllerOptions is created with its default parameters.
</param>
<returns>A task representing the background initialization process.</returns>
<remarks>All the event handlers added here need to be removed in <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.Dispose(System.Boolean)"/>.</remarks>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CreateParams">
<summary>
Protected CreateParams property. Used to set custom window styles to the forms HWND.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnVisibleChanged(System.EventArgs)">
<summary>
Protected VisibilityChanged handler.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnSizeChanged(System.EventArgs)">
<summary>
Protected SizeChanged handler.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Select(System.Boolean,System.Boolean)">
<summary>
Protected Select method: override this to capture tab direction when WebView control is activated
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnGotFocus(System.EventArgs)">
<summary>
Protected OnGotFocus handler.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnParentChanged(System.EventArgs)">
<summary>
Protected OnParentChanged handler.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.IsInitialized">
<summary>
True if initialization finished successfully and the control is not disposed yet.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.GetSitedParentSite(System.Windows.Forms.Control)">
<summary>
Recursive retrieval of the parent control
</summary>
<param name="control">The control to get the parent for</param>
<returns>The root parent control</returns>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2">
<summary>
The underlying CoreWebView2. Use this property to perform more operations on the WebView2 content than is exposed
on the WebView2. This value is null until it is initialized and the object itself has undefined behaviour once the control is disposed.
You can force the underlying CoreWebView2 to
initialize via the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> method.
</summary>
<exception cref="T:System.InvalidOperationException">Thrown if the calling thread isn't the thread which created this object (usually the UI thread). See <see cref="P:System.Windows.Forms.Control.InvokeRequired"/> for more info.</exception>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.ZoomFactor">
<summary>
The zoom factor for the WebView.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.AllowExternalDrop">
<summary>
Enable/disable external drop.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.Source">
<summary>
The Source property is the URI of the top level document of the
WebView2. Setting the Source is equivalent to calling <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Navigate(System.String)"/>.
Setting the Source will trigger initialization of the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>, if not already initialized.
The default value of Source is <c>null</c>, indicating that the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.
</summary>
<exception cref="T:System.ArgumentException">Specified value is not an absolute <see cref="T:System.Uri"/>.</exception>
<exception cref="T:System.NotImplementedException">Specified value is <c>null</c> and the control is initialized.</exception>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Navigate(System.String)"/>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CanGoForward">
<summary>
Returns true if the webview can navigate to a next page in the
navigation history via the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.GoForward"/> method.
This is equivalent to the <see cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoForward"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this property is <c>false</c>.
</summary>
<seealso cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoForward"/>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CanGoBack">
<summary>
Returns <c>true</c> if the webview can navigate to a previous page in the
navigation history via the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.GoBack"/> method.
This is equivalent to the <see cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoBack"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this property is <c>false</c>.
</summary>
<seealso cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoBack"/>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.DefaultBackgroundColor">
<summary>
The default background color for the WebView.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.ExecuteScriptAsync(System.String)">
<summary>
Executes the provided script in the top level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.ExecuteScriptAsync(System.String)"/>.
</summary>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.</exception>
<exception cref="T:System.InvalidOperationException">Thrown when browser process has unexpectedly and left this control in an invalid state. We are considering throwing a different type of exception for this case in the future.</exception>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.ExecuteScriptAsync(System.String)"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Reload">
<summary>
Reloads the top level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Reload"/>.
</summary>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.</exception>
<exception cref="T:System.InvalidOperationException">Thrown when browser process has unexpectedly and left this control in an invalid state. We are considering throwing a different type of exception for this case in the future.</exception>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Reload"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.GoForward">
<summary>
Navigates to the next page in navigation history.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoForward"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this method does nothing.
</summary>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoForward"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.GoBack">
<summary>
Navigates to the previous page in navigation history.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoBack"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this method does nothing.
</summary>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoBack"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.NavigateToString(System.String)">
<summary>
Renders the provided HTML as the top level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.NavigateToString(System.String)"/>.
</summary>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.</exception>
<exception cref="T:System.InvalidOperationException">Thrown when browser process has unexpectedly and left this control in an invalid state. We are considering throwing a different type of exception for this case in the future.</exception>
<remarks>The <c>htmlContent</c> parameter may not be larger than 2 MB (2 * 1024 * 1024 bytes) in total size. The origin of the new page is <c>about:blank</c>.</remarks>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.NavigateToString(System.String)"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Stop">
<summary>
Stops any in progress navigation in the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Stop"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this method does nothing.
</summary>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Stop"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted">
<summary>
This event is triggered either 1) when the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> has finished being initialized (regardless of how it was triggered or whether it succeeded) but before it is used for anything
OR 2) the initialization failed.
You should handle this event if you need to perform one time setup operations on the CoreWebView2 which you want to affect all of its usages
(e.g. adding event handlers, configuring settings, installing document creation scripts, adding host objects).
</summary>
<remarks>
This sender will be the WebView2 control, whose CoreWebView2 property will now be valid (i.e. non-null) for the first time
if <see cref="P:Microsoft.Web.WebView2.Core.CoreWebView2InitializationCompletedEventArgs.IsSuccess"/> is true.
Unlikely this event can fire second time (after reporting initialization success first)
if the initialization is followed by navigation which fails.
</remarks>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.NavigationStarting">
<summary>
NavigationStarting dispatches before a new navigate starts for the top
level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationStarting"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationStarting"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.NavigationCompleted">
<summary>
NavigationCompleted dispatches after a navigate of the top level
document completes rendering either successfully or not.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationCompleted"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationCompleted"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.WebMessageReceived">
<summary>
WebMessageReceived dispatches after web content sends a message to the
app host via <c>chrome.webview.postMessage</c>.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.WebMessageReceived"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.WebMessageReceived"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.SourceChanged">
<summary>
SourceChanged dispatches after the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property changes. This may happen
during a navigation or if otherwise the script in the page changes the
URI of the document.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.SourceChanged"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.SourceChanged"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.ContentLoading">
<summary>
ContentLoading dispatches after a navigation begins to a new URI and the
content of that URI begins to render.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.ContentLoading"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.ContentLoading"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.ZoomFactorChanged">
<summary>
ZoomFactorChanged dispatches when the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.ZoomFactor"/> property changes.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2Controller.ZoomFactorChanged"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2Controller.ZoomFactorChanged"/>
</member>
<member name="F:Microsoft.Web.WebView2.WinForms.WebView2.components">
<summary>
Required designer variable.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.InitializeComponent">
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
</member>
</members>
</doc>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
<FileList>
<File Reference = "Microsoft.Web.WebView2.Wpf.dll" >
<ToolboxItems UIFramework="WPF" VSCategory="WebView2" BlendCategory="WebView2">
<Item Type="Microsoft.Web.WebView2.Wpf.WebView2" />
</ToolboxItems>
</File>
<File Reference = "Microsoft.Web.WebView2.WinForms.dll" >
<ToolboxItems UIFramework="WinForms" VSCategory="WebView2">
<Item Type="Microsoft.Web.WebView2.WinForms.WebView2" />
</ToolboxItems>
</File>
</FileList>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,54 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>wv2winrt</name>
</assembly>
<members>
<member name="M:wv2winrt.Program.Main(System.String[],System.String,System.String,System.Boolean,System.String[],System.String[],System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.String,System.Boolean)">
<summary>
Given WinMD files, produce C++ code that implements COM IDispatch wrappers around the types in those WinMD files.
</summary>
<remarks>
There are several mechanisms to filter out types from the winmd that should not have code generated. They are
applied in the following order of precedence:
1. If the requireAllowForWebAttribute switch is set, then only types
with the AllowForWeb attribute will be considered.
2. If the ignoreWebHostHiddenAttribute switch is set, then types with
the WebHostHidden attribute will still be included.
3. Explicit include and exclude rules sorted by the length of the
rule string. So more general rules are applied first followed by
more and more specific rules. If rule text matches the type or
namespace name, then the type is included or excluded based on
the kind of rule.
4. If the explicitIncludesOnly switch is set, only the types explicitly
listed by the --include switch will be included.
By default, wv2winrt includes all types
referenced by other included types. This applies recursively, so
a type included due to this will also include all types
it references.
5. If there are no explicit include rules then a type that doesn't
match any previous rule (1. to 4.) is included. Otherwise it is
excluded.
</remarks>
<param name="winmdPaths">Path(s) to winmd files containing types to generate code from/for.</param>
<param name="outputPath">Path to a folder into which to place generated source code. Or `--` to write all generated code to standard out.</param>
<param name="outputNamespace">Namespace where generated source code will be placed.</param>
<param name="useFullNamespace">If set, wv2winrt will use full namespace names for dispatch adapter source files. Use this option when the output namespace is different to the consuming project's root namespace.</param>
<param name="useJavascriptCase">If set, wv2winrt will use javascript casing for projection properties, methods, and events.</param>
<param name="explicitIncludesOnly">If set, wv2winrt won't automatically follow references from other included types.</param>
<param name="requireAllowForWebAttribute">If set, wv2winrt will only generate wrappers for runtimeclasses with the AllowForWeb attribute. By default, runtimeclasses with or without the AllowForWeb attribute will be included and will have wrapper code generated.</param>
<param name="ignoreWebHostHiddenAttribute">If set, wv2winrt will generate wrappers for runtimeclasses with the WebHostHidden attribute. By default, runtimeclasses with the WebHostHidden attribute will be skipped and will not have generated wrapper code.</param>
<param name="pch">Optional precompiled header filename of the project consuming the generated source code.</param>
<param name="idl">Optional flag to generate only the idl file. Run with this option before MIDL if the consuming project defines its own WinRT types.</param>
<param name="include">List of namespaces or runtimeclass names to be included in the generated output.</param>
<param name="exclude">List of namespaces or runtimeclass names to be excluded from the generated output.</param>
<param name="verbose">If set, generate verbose output including when a namespace or runtimeclass is excluded.</param>
</member>
</members>
</doc>