Multi-targetting all projects.

New SDK version.
This commit is contained in:
Alexandre Zollinger Chohfi 2019-01-02 17:13:28 -08:00
Родитель feeb8e5003
Коммит 5d0b4e6143
54 изменённых файлов: 451 добавлений и 489 удалений

Просмотреть файл

@ -43,10 +43,11 @@
- /azure-pipelines.yml
This also needs to be installed on your local machine. Can do this with PowerShell:
./build/Install-WindowsSDKISO.ps1 17763
./build/Install-WindowsSDKISO.ps1 18298
-->
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
<TargetPlatformVersion>10.0.18298.0</TargetPlatformVersion>
<!-- XAML Islands require SDK 18226 -->
<TargetPlatformMinVersion>10.0.18226.0</TargetPlatformMinVersion>
<!-- Compiler -->
<FileAlignment>512</FileAlignment>

Просмотреть файл

@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<TargetFrameworks>net462;netcoreapp3.0</TargetFrameworks>
<RootNamespace>Microsoft.Toolkit.Forms.UI.Controls</RootNamespace>
<AssemblyName>Microsoft.Toolkit.Forms.UI.Controls.WebView</AssemblyName>
<RunCodeAnalysis>true</RunCodeAnalysis>
<Title>Windows Community Toolkit WebView Windows Forms Controls</Title>
<Description>This library provides WebView user controls for Windows Forms. It is part of the Windows Community Toolkit.</Description>
@ -15,6 +14,16 @@
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<UseWindowsForms>true</UseWindowsForms>
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net462'">
<!--<RunCodeAnalysis>true</RunCodeAnalysis>-->
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>$(DefineConstants);DEV_DEBUG;DEBUG_LAYOUT;</DefineConstants>
</PropertyGroup>
@ -30,7 +39,11 @@
<Compile Update="..\WebView.Shared\DesignerUI.Designer.cs" Link="DesignerUI.Designer.cs" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition=" '$(RunCodeAnalysis)' == 'true' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Design" />
@ -45,4 +58,14 @@
<HintPath>$(WINDIR)\Microsoft.NET\Framework\v4.0.30319\System.Runtime.WindowsRuntime.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview.18571.3" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview.18571.3" />
<Reference Include="Windows">
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.18298.0\Windows.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
</ItemGroup>
</Project>

Просмотреть файл

@ -8,9 +8,6 @@
<Title>Windows Community Toolkit Windows Forms Controls</Title>
<Description>This library provides XAML user controls for Windows Forms. It is part of the Windows Community Toolkit.</Description>
<PackageTags>Win32 WindowsForms UWP XAML</PackageTags>
<!--XamlHost requires 17692 -->
<TargetPlatformMinVersion>10.0.17692.0</TargetPlatformMinVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
@ -56,10 +53,10 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview1-27018-01" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview1-27018-01" />
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview.18571.3" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview.18571.3" />
<Reference Include="Windows">
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.17763.0\Windows.winmd</HintPath>
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.18298.0\Windows.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>

Просмотреть файл

@ -8,11 +8,6 @@
<Title>Windows Community Toolkit XAMLHost for Windows Forms</Title>
<Description>This library provides XAML islands interop helpers for Windows Forms. It is part of the Windows Community Toolkit.</Description>
<PackageTags>XAML Islands Win32 Forms WindowsForms WinForms XamlHost</PackageTags>
<!--
Need class WIndows.UI.Xaml.Hosting.DesktopWindowXamlSource, which was introduced in Insiders SDK 17692 on 19-Jun 2018
-->
<TargetPlatformMinVersion>10.0.17692.0</TargetPlatformMinVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
@ -64,10 +59,10 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview1-27018-01" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview1-27018-01" />
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview.18571.3" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview.18571.3" />
<Reference Include="Windows">
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.17763.0\Windows.winmd</HintPath>
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.18298.0\Windows.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>

Просмотреть файл

@ -5,6 +5,7 @@
using Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT;
using System;
using System.Windows.Forms;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.Samples.WinForms.App
{
@ -19,45 +20,45 @@ namespace Microsoft.Toolkit.Win32.Samples.WinForms.App
{
inkCanvas1.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Pen | CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Touch;
var stackPanel = new Windows.UI.Xaml.Controls.StackPanel()
var stackPanel = new windows.UI.Xaml.Controls.StackPanel()
{
Background = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Black),
Background = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Black),
};
stackPanel.Children.Add(new Windows.UI.Xaml.Shapes.Rectangle()
stackPanel.Children.Add(new windows.UI.Xaml.Shapes.Rectangle()
{
Width = 50,
Height = 75,
Fill = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Blue),
Fill = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Blue),
});
stackPanel.Children.Add(new Windows.UI.Xaml.Shapes.Rectangle()
stackPanel.Children.Add(new windows.UI.Xaml.Shapes.Rectangle()
{
Width = 200,
Height = 30,
Fill = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Red),
Fill = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Red),
});
stackPanel.Children.Add(new Windows.UI.Xaml.Controls.Button()
stackPanel.Children.Add(new windows.UI.Xaml.Controls.Button()
{
Width = 160,
Height = 60,
HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center,
HorizontalAlignment = windows.UI.Xaml.HorizontalAlignment.Center,
Content = "This is a UWP Button",
});
stackPanel.Children.Add(new Windows.UI.Xaml.Shapes.Rectangle()
stackPanel.Children.Add(new windows.UI.Xaml.Shapes.Rectangle()
{
Width = 25,
Height = 100,
Fill = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Green),
Fill = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Green),
});
stackPanel.Children.Add(new Windows.UI.Xaml.Controls.Button()
stackPanel.Children.Add(new windows.UI.Xaml.Controls.Button()
{
Width = 300,
Height = 40,
HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center,
HorizontalAlignment = windows.UI.Xaml.HorizontalAlignment.Center,
Content = "Another long UWP Button",
});

Просмотреть файл

@ -1,40 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9C49A885-D39B-4CA0-9DEB-204A6EA7D453}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Microsoft.Toolkit.Win32.Samples.WinForms.App</RootNamespace>
<AssemblyName>Microsoft.Toolkit.Win32.Samples.WinForms.App</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net462;netcoreapp3.0</TargetFrameworks>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<AssemblyTitle>Windows Community Toolkit Controls (Sample Xaml Island Wrapper Controls for .NET Windows Forms)</AssemblyTitle>
<Description>Sample Code for Windows Community Toolkit Controls</Description>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
@ -56,39 +32,19 @@
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview.18571.3" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview.18571.3" />
<Reference Include="Windows">
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.18298.0\Windows.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="app.manifest" />
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
@ -105,8 +61,7 @@
<Name>Microsoft.Toolkit.Forms.UI.XamlHost</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="Pack">
<!-- No-op to avoid build error when packing solution from commandline -->
<!-- No-op to avoid build error when packing solution from commandline -->
</Target>
</Project>

Просмотреть файл

@ -1,29 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.Toolkit.Win32.Samples.WinForms.App")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Microsoft.Toolkit.Win32.Samples.WinForms.App")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9c49a885-d39b-4ca0-9deb-204a6ea7d453")]

Просмотреть файл

@ -8,10 +8,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace Microsoft.Toolkit.Win32.Samples.WinForms.App.Properties
{
namespace Microsoft.Toolkit.Sample.Forms.App.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@ -19,51 +19,43 @@ namespace Microsoft.Toolkit.Win32.Samples.WinForms.App.Properties
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Toolkit.Win32.Samples.WinForms.App.Properties.Resources", typeof(Resources).Assembly);
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Toolkit.Sample.Forms.App.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net462</TargetFramework>
<TargetFrameworks>net462;netcoreapp3.0</TargetFrameworks>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AssemblyTitle>Windows Community Toolkit Controls (Sample WebView for .NET Forms)</AssemblyTitle>
<Description>Sample Code for Windows Community Toolkit Controls</Description>
@ -9,39 +9,14 @@
<Target Name="Pack">
<!-- No-op to avoid build error when packing solution from commandline -->
</Target>
<ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Update="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<EmbeddedResource Update="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Update="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Update="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Forms.UI.Controls.WebView\Microsoft.Toolkit.Forms.UI.Controls.WebView.csproj" />

Просмотреть файл

@ -19,7 +19,7 @@ namespace Microsoft.Toolkit.Sample.Forms.WebView.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {

Просмотреть файл

@ -6,6 +6,7 @@
xmlns:xamlhost="clr-namespace:Microsoft.Toolkit.Wpf.UI.XamlHost;assembly=Microsoft.Toolkit.Wpf.UI.XamlHost"
xmlns:controls="clr-namespace:Microsoft.Toolkit.Wpf.UI.Controls;assembly=Microsoft.Toolkit.Wpf.UI.Controls"
xmlns:controls1="clr-namespace:Microsoft.Toolkit.Wpf.UI.Controls;assembly=Microsoft.Toolkit.Wpf.UI.Controls.WebView"
xmlns:x1="clr-namespace:System.Windows.Markup;assembly=System.Xaml"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid >
@ -13,7 +14,7 @@
<TabItem>
<TabItem.Header>Ink Controls (Canvas / Toolbar)</TabItem.Header>
<DockPanel LastChildFill="True" >
<controls:InkToolbar DockPanel.Dock="Top" x:Name="inkToolbar" Grid.Row="0" TargetInkCanvas="{x:Reference Name=inkCanvas}" Initialized="inkToolbar_Initialized" ActiveToolChanged="inkToolbar_ActiveToolChanged" >
<controls:InkToolbar DockPanel.Dock="Top" x:Name="inkToolbar" Grid.Row="0" TargetInkCanvas="{x1:Reference Name=inkCanvas}" Initialized="inkToolbar_Initialized" ActiveToolChanged="inkToolbar_ActiveToolChanged" >
<controls:InkToolbarCustomToolButton x:Name="toolButtonLasso" />
</controls:InkToolbar>
<!--Inking area -->

Просмотреть файл

@ -5,6 +5,7 @@
using System;
using System.Windows;
using Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT;
using windows = Windows;
namespace Microsoft.Toolkit.Sample.Wpf.App
{
@ -13,7 +14,7 @@ namespace Microsoft.Toolkit.Sample.Wpf.App
/// </summary>
public partial class MainWindow : Window
{
private Windows.UI.Xaml.Controls.ContentDialog _contentDialog;
private windows.UI.Xaml.Controls.ContentDialog _contentDialog;
public MainWindow()
{
@ -47,58 +48,58 @@ namespace Microsoft.Toolkit.Sample.Wpf.App
private void WindowsXamlHost_Loaded(object sender, RoutedEventArgs e)
{
Windows.UI.Xaml.Controls.StackPanel stackPanel = new Windows.UI.Xaml.Controls.StackPanel()
windows.UI.Xaml.Controls.StackPanel stackPanel = new windows.UI.Xaml.Controls.StackPanel()
{
Background = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Black),
Background = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Black),
};
stackPanel.Children.Add(new Windows.UI.Xaml.Shapes.Rectangle()
stackPanel.Children.Add(new windows.UI.Xaml.Shapes.Rectangle()
{
Width = 50,
Height = 75,
Fill = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Blue),
Fill = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Blue),
});
stackPanel.Children.Add(new Windows.UI.Xaml.Shapes.Rectangle()
stackPanel.Children.Add(new windows.UI.Xaml.Shapes.Rectangle()
{
Width = 200,
Height = 30,
Fill = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Red),
Fill = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Red),
});
var button = new Windows.UI.Xaml.Controls.Button()
var button = new windows.UI.Xaml.Controls.Button()
{
Width = 160,
Height = 60,
HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center,
HorizontalAlignment = windows.UI.Xaml.HorizontalAlignment.Center,
Content = "ContentDialog UWP Button",
};
button.Tapped += Button_Tapped;
stackPanel.Children.Add(button);
stackPanel.Children.Add(new Windows.UI.Xaml.Shapes.Rectangle()
stackPanel.Children.Add(new windows.UI.Xaml.Shapes.Rectangle()
{
Width = 25,
Height = 100,
Fill = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Green),
Fill = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Green),
});
Windows.UI.Xaml.Controls.Flyout flyout = new Windows.UI.Xaml.Controls.Flyout();
flyout.Content = new Windows.UI.Xaml.Controls.TextBlock() { Text = "Flyout content", };
windows.UI.Xaml.Controls.Flyout flyout = new windows.UI.Xaml.Controls.Flyout();
flyout.Content = new windows.UI.Xaml.Controls.TextBlock() { Text = "Flyout content", };
var button2 = new Windows.UI.Xaml.Controls.Button()
var button2 = new windows.UI.Xaml.Controls.Button()
{
Width = 300,
Height = 40,
HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center,
HorizontalAlignment = windows.UI.Xaml.HorizontalAlignment.Center,
Content = "Long UWP Button with Flyout",
Flyout = flyout,
};
stackPanel.Children.Add(button2);
var comboBox = new Windows.UI.Xaml.Controls.ComboBox()
var comboBox = new windows.UI.Xaml.Controls.ComboBox()
{
HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center,
HorizontalAlignment = windows.UI.Xaml.HorizontalAlignment.Center,
};
comboBox.Items.Add("One");
comboBox.Items.Add("Two");
@ -106,25 +107,25 @@ namespace Microsoft.Toolkit.Sample.Wpf.App
comboBox.Items.Add("Four");
stackPanel.Children.Add(comboBox);
Windows.UI.Xaml.Controls.Grid grid = new Windows.UI.Xaml.Controls.Grid();
windows.UI.Xaml.Controls.Grid grid = new windows.UI.Xaml.Controls.Grid();
stackPanel.Children.Add(grid);
_contentDialog = new Windows.UI.Xaml.Controls.ContentDialog();
_contentDialog.Content = new Windows.UI.Xaml.Controls.TextBlock() { Text = "ContentDialog content", };
_contentDialog = new windows.UI.Xaml.Controls.ContentDialog();
_contentDialog.Content = new windows.UI.Xaml.Controls.TextBlock() { Text = "ContentDialog content", };
stackPanel.Children.Add(_contentDialog);
var popup = new Windows.UI.Xaml.Controls.Primitives.Popup()
var popup = new windows.UI.Xaml.Controls.Primitives.Popup()
{
Width = 50,
Height = 50,
};
grid.Children.Add(popup);
var canvas = new Windows.UI.Xaml.Controls.Canvas()
var canvas = new windows.UI.Xaml.Controls.Canvas()
{
Width = 50,
Height = 50,
Background = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Green),
Background = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Green),
};
popup.Child = canvas;
@ -132,9 +133,9 @@ namespace Microsoft.Toolkit.Sample.Wpf.App
popup.IsOpen = true;
}
private async void Button_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
private async void Button_Tapped(object sender, windows.UI.Xaml.Input.TappedRoutedEventArgs e)
{
await _contentDialog.ShowAsync(Windows.UI.Xaml.Controls.ContentDialogPlacement.Popup);
await _contentDialog.ShowAsync(windows.UI.Xaml.Controls.ContentDialogPlacement.Popup);
}
}
}

Просмотреть файл

@ -1,25 +1,33 @@
<Project Sdk="MSBuild.Sdk.Extras">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<ProjectGuid>{45524ED2-8B5A-42E8-97A2-DCA44ECC83AA}</ProjectGuid>
<OutputType>WinExe</OutputType>
<TargetFramework>net462</TargetFramework>
<TargetFrameworks>net462;netcoreapp3.0</TargetFrameworks>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<AssemblyTitle>Windows Community Toolkit Controls (Sample Xaml Island Wrapper Controls for .NET WPF)</AssemblyTitle>
<Description>Sample Code for Windows Community Toolkit Controls</Description>
<ExtrasEnableWpfProjectSetup>true</ExtrasEnableWpfProjectSetup>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview.18571.3" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview.18571.3" />
<Reference Include="Windows">
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.18298.0\Windows.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
</PropertyGroup>
<Target Name="Pack">
<!-- No-op to avoid build error when packing solution from commandline -->
</Target>
<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />

Просмотреть файл

@ -19,7 +19,7 @@ namespace Microsoft.Toolkit.Sample.Wpf.App.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {

Просмотреть файл

@ -1,17 +1,17 @@
<Project Sdk="MSBuild.Sdk.Extras">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net462</TargetFramework>
<TargetFrameworks>net462;netcoreapp3.0</TargetFrameworks>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AssemblyTitle>Windows Community Toolkit Controls (Sample WebView for .NET WPF)</AssemblyTitle>
<Description>Sample Code for Windows Community Toolkit Controls</Description>
<ExtrasEnableWpfProjectSetup>true</ExtrasEnableWpfProjectSetup>
<UseWPF>true</UseWPF>
</PropertyGroup>
<Target Name="Pack">
<!-- No-op to avoid build error when packing solution from commandline -->
</Target>
<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System.Xaml" />
<Reference Include="UIAutomationProvider" />
<Reference Include="WindowsBase" />
@ -24,17 +24,4 @@
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Wpf.UI.Controls.WebView\Microsoft.Toolkit.Wpf.UI.Controls.WebView.csproj" />
</ItemGroup>
<!--<ItemGroup>
<Compile Remove="App.xaml.cs" />
<Compile Remove="MainWindow.xaml.cs" />
<Compile Remove="Properties\Resources.Designer.cs" />
<Compile Remove="Properties\Settings.Designer.cs" />
<Compile Remove="obj\Debug\App.g.cs" />
<Compile Remove="obj\Debug\App.g.i.cs" />
<Compile Remove="obj\Debug\MainWindow.g.i.cs" />
<Compile Remove="obj\Debug\Microsoft.Toolkit.Sample.Wpf.WebView.Version.cs" />
<Compile Remove="obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs" />
<Compile Remove="obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs" />
<Compile Remove="obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs" />
</ItemGroup>-->
</Project>

Просмотреть файл

@ -19,7 +19,7 @@ namespace Microsoft.Toolkit.Sample.Wpf.WebView.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {

Просмотреть файл

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2018
# Visual Studio Version 16
VisualStudioVersion = 16.0.28427.150
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{9AFF2EBF-08DA-44C1-AC09-187561FF1147}"
EndProject
@ -39,11 +39,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Toolkit.Wpf.UI.Co
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Toolkit.Sample.Forms.App", "Microsoft.Toolkit.Sample.Forms.App\Microsoft.Toolkit.Sample.Forms.App.csproj", "{9C49A885-D39B-4CA0-9DEB-204A6EA7D453}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{78C0AE18-B6DD-4515-A3B6-D0A05CF3A79E}"
ProjectSection(SolutionItems) = preProject
nuget.config = nuget.config
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

Просмотреть файл

@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<TargetFrameworks>net462;netcoreapp3.0</TargetFrameworks>
<RootNamespace>Microsoft.Toolkit.Wpf.UI.Controls</RootNamespace>
<AssemblyName>Microsoft.Toolkit.Wpf.UI.Controls.WebView</AssemblyName>
<RunCodeAnalysis>true</RunCodeAnalysis>
<Title>Windows Community Toolkit WPF WebView Control</Title>
<Description>This library provides XAML controls for WPF WebView. It is part of the Windows Community Toolkit.</Description>
@ -15,6 +14,16 @@
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<UseWPF>true</UseWPF>
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net462'">
<!--<RunCodeAnalysis>true</RunCodeAnalysis>-->
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>$(DefineConstants);DEV_DEBUG;DEBUG_LAYOUT</DefineConstants>
</PropertyGroup>
@ -28,6 +37,10 @@
<Compile Include="..\Microsoft.Toolkit.Win32.UI.Controls\Interop\WinRT\VirtualKey.cs" LinkBase="Interop/WinRT" />
</ItemGroup>
<ItemGroup Condition=" '$(RunCodeAnalysis)' == 'true' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Support\**" />
<EmbeddedResource Remove="Support\**" />
@ -40,7 +53,7 @@
<Compile Update="..\WebView.Shared\DesignerUI.Designer.cs" Link="DesignerUI.Designer.cs" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
@ -57,6 +70,16 @@
</Reference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview.18571.3" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview.18571.3" />
<Reference Include="Windows">
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.18298.0\Windows.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="VisualStudioToolsManifest.xml" Pack="true" PackagePath="tools" />
</ItemGroup>

Просмотреть файл

@ -23,6 +23,7 @@ using Microsoft.Toolkit.Win32.UI.Controls.Interop.Win32;
using Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT;
using Point = Windows.Foundation.Point;
using Size = Windows.Foundation.Size;
using windows = Windows;
/*
@ -782,7 +783,7 @@ namespace Microsoft.Toolkit.Wpf.UI.Controls
if (_webViewControl == null)
{
var handle = ChildWindow.Handle;
var bounds = new Windows.Foundation.Rect(0, 0, RenderSize.Width * DpiScale.DpiScaleX, RenderSize.Height * DpiScale.DpiScaleY);
var bounds = new windows.Foundation.Rect(0, 0, RenderSize.Width * DpiScale.DpiScaleX, RenderSize.Height * DpiScale.DpiScaleY);
_webViewControl = await _process.CreateWebViewControlHostAsync(handle, bounds).ConfigureAwait(false);
}
@ -1212,7 +1213,7 @@ namespace Microsoft.Toolkit.Wpf.UI.Controls
#endif
if (WebViewControlInitialized)
{
var rect = new Windows.Foundation.Rect(
var rect = new windows.Foundation.Rect(
new Point(x, y),
new Size(width, height));

Просмотреть файл

@ -10,6 +10,7 @@ using System.Windows.Interop;
using System.Windows.Media;
using Microsoft.Toolkit.Win32.UI.Controls;
using Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT;
using windows = Windows;
namespace Microsoft.Toolkit.Wpf.UI.Controls
{
@ -169,7 +170,7 @@ namespace Microsoft.Toolkit.Wpf.UI.Controls
Verify.IsNotNull(process);
Verify.IsFalse(hostWindowHandle == IntPtr.Zero);
var rect = new Windows.Foundation.Rect(bounds.X, bounds.Y, bounds.Width, bounds.Height);
var rect = new windows.Foundation.Rect(bounds.X, bounds.Y, bounds.Width, bounds.Height);
return process
.CreateWebViewControlHostAsync(hostWindowHandle, rect)
.GetAwaiter()
@ -185,7 +186,7 @@ namespace Microsoft.Toolkit.Wpf.UI.Controls
Verify.IsNotNull(process);
Verify.IsFalse(hostWindowHandle == IntPtr.Zero);
var rect = new Windows.Foundation.Rect(bounds.X, bounds.Y, bounds.Width, bounds.Height);
var rect = new windows.Foundation.Rect(bounds.X, bounds.Y, bounds.Width, bounds.Height);
return process.CreateWebViewControlHostAsync(hostWindowHandle, rect);
}
}

Просмотреть файл

@ -10,9 +10,6 @@
<PackageTags>Win32 WPF UWP XAML</PackageTags>
<DefineConstants>$(DefineConstants);WPF</DefineConstants>
<!--XamlHost requires 17692 -->
<TargetPlatformMinVersion>10.0.17692.0</TargetPlatformMinVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
@ -89,10 +86,10 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview1-27018-01" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview1-27018-01" />
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview.18571.3" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview.18571.3" />
<Reference Include="Windows">
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.17763.0\Windows.winmd</HintPath>
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.18298.0\Windows.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>

Просмотреть файл

@ -9,11 +9,6 @@
<Description>This library provides XAML islands helpers for WPF. It is part of the Windows Community Toolkit.</Description>
<PackageTags>XAML Islands Win32 WPF XAMLHost</PackageTags>
<PackageId>Microsoft.Toolkit.Wpf.UI.XamlHost</PackageId>
<!--
Need class WIndows.UI.Xaml.Hosting.DesktopWindowXamlSource, which was introduced in Insiders SDK 17692 on 19-Jun 2018
-->
<TargetPlatformMinVersion>10.0.17692.0</TargetPlatformMinVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
@ -53,10 +48,10 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview1-27018-01" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview1-27018-01" />
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.6.0-preview.18571.3" />
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml" Version="4.6.0-preview.18571.3" />
<Reference Include="Windows">
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.17763.0\Windows.winmd</HintPath>
<HintPath>$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\10.0.18298.0\Windows.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>

Просмотреть файл

@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls
{
@ -15,7 +16,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls
/// </summary>
/// <seealso cref="T:System.IDisposable" />
/// <remarks>
/// Subset of functionality from <see cref="T:Windows.Web.UI.IWebViewControl" />
/// Subset of functionality from <see cref="T:windows.Web.UI.IWebViewControl" />
/// </remarks>
public interface IWebView
{
@ -100,7 +101,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls
/// Occurs when an action in a <see cref="IWebView"/> requires that permission be granted.
/// </summary>
/// <remarks>
/// The types of permission that can be requested are defined in the <see cref="Windows.Web.UI.WebViewControlPermissionType"/> enumeration.
/// The types of permission that can be requested are defined in the <see cref="windows.Web.UI.WebViewControlPermissionType"/> enumeration.
///
/// If you don't handle the <see cref="PermissionRequested"/> event, the <see cref="IWebView"/> denies permission by default.
///
@ -361,7 +362,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls
/// <remarks>
/// This method only supports <see cref="HttpMethod.Get"/> and <see cref="HttpMethod.Post"/> for the <paramref name="httpMethod"/> parameter.
/// </remarks>
/// <seealso cref="Windows.Web.UI.Interop.WebViewControl.NavigateWithHttpRequestMessage"/>
/// <seealso cref="windows.Web.UI.Interop.WebViewControl.NavigateWithHttpRequestMessage"/>
void Navigate(
Uri requestUri,
HttpMethod httpMethod,

Просмотреть файл

@ -7,13 +7,14 @@ using System.IO;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Storage.Streams;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// An adapter converting <see cref="IUriToStreamResolver"/> to <see cref="Windows.Web.IUriToStreamResolver"/>.
/// An adapter converting <see cref="IUriToStreamResolver"/> to <see cref="windows.Web.IUriToStreamResolver"/>.
/// </summary>
internal sealed class GenericUriToStreamResolver : Windows.Web.IUriToStreamResolver, IUriToStreamResolver
internal sealed class GenericUriToStreamResolver : windows.Web.IUriToStreamResolver, IUriToStreamResolver
{
private readonly IUriToStreamResolver _streamResolver;

Просмотреть файл

@ -4,13 +4,14 @@
using System;
using System.IO;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Provides a method to translate a Uniform Resource I (URI) to a <see cref="Stream"/> for use by the <see cref="IWebView.NavigateToLocal(string)"/> method.
/// </summary>
/// <seealso cref="Windows.Web.IUriToStreamResolver"/>
/// <seealso cref="windows.Web.IUriToStreamResolver"/>
public interface IUriToStreamResolver
{
Stream UriToStream(Uri uri);

Просмотреть файл

@ -2,13 +2,15 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Defines errors encountered during operations involving web services, such as authentication, proxy configuration, and destination URIs.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.WebErrorStatus"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="Windows.Web.WebErrorStatus" />
/// <remarks>Copy from <see cref="windows.Web.WebErrorStatus"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="windows.Web.WebErrorStatus" />
public enum WebErrorStatus
{
/// <summary>

Просмотреть файл

@ -4,19 +4,20 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <seealso cref="Windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs"/>
/// <seealso cref="windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs"/>
/// <summary>This class provides information for the <see cref="IWebView.AcceleratorKeyPressed"/> event.</summary>
/// <seealso cref="System.EventArgs" />
public sealed class WebViewControlAcceleratorKeyPressedEventArgs : EventArgs
{
[SecurityCritical]
private readonly Windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs _args;
private readonly windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs _args;
[SecurityCritical]
internal WebViewControlAcceleratorKeyPressedEventArgs(Windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs args)
internal WebViewControlAcceleratorKeyPressedEventArgs(windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs args)
{
_args = args;
}
@ -64,13 +65,13 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs"/> to <see cref="WebViewControlAcceleratorKeyPressedEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs"/> to <see cref="WebViewControlAcceleratorKeyPressedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
[SecurityCritical]
public static implicit operator WebViewControlAcceleratorKeyPressedEventArgs(
Windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs args)
windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs args)
{
return new WebViewControlAcceleratorKeyPressedEventArgs(args);
}

Просмотреть файл

@ -2,11 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>An enumeration that describes the accelerator key routing stage.</summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.Interop.WebViewControlAcceleratorKeyRoutingStage"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="Windows.Web.UI.Interop.WebViewControlAcceleratorKeyRoutingStage"/>
/// <remarks>Copy from <see cref="windows.Web.UI.Interop.WebViewControlAcceleratorKeyRoutingStage"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="windows.Web.UI.Interop.WebViewControlAcceleratorKeyRoutingStage"/>
public enum WebViewControlAcceleratorKeyRoutingStage
{
#pragma warning disable 1591

Просмотреть файл

@ -5,18 +5,19 @@
using System;
using System.Security;
using System.Windows.Forms;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Provides data for the <see cref="IWebView.ContentLoading"/> and <see cref="IWebView.FrameContentLoading"/> events. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlContentLoadingEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="Windows.Web.UI.WebViewControlContentLoadingEventArgs"/>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlContentLoadingEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="windows.Web.UI.WebViewControlContentLoadingEventArgs"/>
public sealed class WebViewControlContentLoadingEventArgs : EventArgs
{
[SecurityCritical]
private readonly Windows.Web.UI.WebViewControlContentLoadingEventArgs _winrtArgs;
private readonly windows.Web.UI.WebViewControlContentLoadingEventArgs _winrtArgs;
#if WINFORMS
[SecurityCritical]
private readonly WebBrowserNavigatingEventArgs _formArgs;
@ -28,7 +29,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
#endif
[SecurityCritical]
internal WebViewControlContentLoadingEventArgs(Windows.Web.UI.WebViewControlContentLoadingEventArgs args)
internal WebViewControlContentLoadingEventArgs(windows.Web.UI.WebViewControlContentLoadingEventArgs args)
{
_winrtArgs = args;
}
@ -67,23 +68,23 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlContentLoadingEventArgs"/> to <see cref="WebViewControlContentLoadingEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlContentLoadingEventArgs"/> to <see cref="WebViewControlContentLoadingEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlContentLoadingEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlContentLoadingEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
[SecurityCritical]
public static implicit operator WebViewControlContentLoadingEventArgs(
Windows.Web.UI.WebViewControlContentLoadingEventArgs args)
windows.Web.UI.WebViewControlContentLoadingEventArgs args)
{
return FromWebViewControlContentLoadingEventArgs(args);
}
/// <summary>
/// Creates a <see cref="WebViewControlContentLoadingEventArgs"/> from <see cref="Windows.Web.UI.WebViewControlContentLoadingEventArgs"/>.
/// Creates a <see cref="WebViewControlContentLoadingEventArgs"/> from <see cref="windows.Web.UI.WebViewControlContentLoadingEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlContentLoadingEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlContentLoadingEventArgs"/> instance containing the event data.</param>
/// <returns><see cref="WebViewControlContentLoadingEventArgs"/></returns>
public static WebViewControlContentLoadingEventArgs FromWebViewControlContentLoadingEventArgs(Windows.Web.UI.WebViewControlContentLoadingEventArgs args)
public static WebViewControlContentLoadingEventArgs FromWebViewControlContentLoadingEventArgs(windows.Web.UI.WebViewControlContentLoadingEventArgs args)
{
return new WebViewControlContentLoadingEventArgs(args);
}

Просмотреть файл

@ -4,20 +4,21 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Represents a deferred request for permissions in an <see cref="IWebView"/>. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlDeferredPermissionRequest"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="Windows.Web.UI.WebViewControlDeferredPermissionRequest"/>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlDeferredPermissionRequest"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="windows.Web.UI.WebViewControlDeferredPermissionRequest"/>
public sealed class WebViewControlDeferredPermissionRequest
{
[SecurityCritical]
private readonly Windows.Web.UI.WebViewControlDeferredPermissionRequest _webViewControlDeferredPermissionRequest;
private readonly windows.Web.UI.WebViewControlDeferredPermissionRequest _webViewControlDeferredPermissionRequest;
internal WebViewControlDeferredPermissionRequest(Windows.Web.UI.WebViewControlDeferredPermissionRequest webViewControlDeferredPermissionRequest)
internal WebViewControlDeferredPermissionRequest(windows.Web.UI.WebViewControlDeferredPermissionRequest webViewControlDeferredPermissionRequest)
{
_webViewControlDeferredPermissionRequest = webViewControlDeferredPermissionRequest;
}
@ -38,18 +39,18 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public Uri Uri => _webViewControlDeferredPermissionRequest.Uri;
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlDeferredPermissionRequest"/> to <see cref="WebViewControlDeferredPermissionRequest"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlDeferredPermissionRequest"/> to <see cref="WebViewControlDeferredPermissionRequest"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlDeferredPermissionRequest"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlDeferredPermissionRequest"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlDeferredPermissionRequest(Windows.Web.UI.WebViewControlDeferredPermissionRequest args) => ToWebViewControlDeferredPermissionRequest(args);
public static implicit operator WebViewControlDeferredPermissionRequest(windows.Web.UI.WebViewControlDeferredPermissionRequest args) => ToWebViewControlDeferredPermissionRequest(args);
/// <summary>
/// Creates a <see cref="WebViewControlDeferredPermissionRequest"/> from <see cref="Windows.Web.UI.WebViewControlDeferredPermissionRequest"/>.
/// Creates a <see cref="WebViewControlDeferredPermissionRequest"/> from <see cref="windows.Web.UI.WebViewControlDeferredPermissionRequest"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlDeferredPermissionRequest"/> instance containing the deferred permission request.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlDeferredPermissionRequest"/> instance containing the deferred permission request.</param>
/// <returns><see cref="WebViewControlDeferredPermissionRequest"/>.</returns>
public static WebViewControlDeferredPermissionRequest ToWebViewControlDeferredPermissionRequest(Windows.Web.UI.WebViewControlDeferredPermissionRequest args) => new WebViewControlDeferredPermissionRequest(args);
public static WebViewControlDeferredPermissionRequest ToWebViewControlDeferredPermissionRequest(windows.Web.UI.WebViewControlDeferredPermissionRequest args) => new WebViewControlDeferredPermissionRequest(args);
/// <summary>
/// Grants the requested permission.

Просмотреть файл

@ -4,14 +4,15 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Provides data for the <see cref="IWebView.DOMContentLoaded"/> and <see cref="IWebView.FrameDOMContentLoaded"/> events. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="Windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/>
/// <seealso cref="EventArgs"/>
[System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Naming",
@ -21,7 +22,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public sealed class WebViewControlDOMContentLoadedEventArgs : EventArgs
{
[SecurityCritical]
internal WebViewControlDOMContentLoadedEventArgs(Windows.Web.UI.WebViewControlDOMContentLoadedEventArgs args)
internal WebViewControlDOMContentLoadedEventArgs(windows.Web.UI.WebViewControlDOMContentLoadedEventArgs args)
{
Uri = args.Uri;
}
@ -38,19 +39,19 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public Uri Uri { get; }
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/> to <see cref="WebViewControlDOMContentLoadedEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/> to <see cref="WebViewControlDOMContentLoadedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlDOMContentLoadedEventArgs(Windows.Web.UI.WebViewControlDOMContentLoadedEventArgs args) => FromWebViewControlDOMContentLoadedEventArgs(args);
public static implicit operator WebViewControlDOMContentLoadedEventArgs(windows.Web.UI.WebViewControlDOMContentLoadedEventArgs args) => FromWebViewControlDOMContentLoadedEventArgs(args);
/// <summary>
/// Creates a <see cref="WebViewControlDOMContentLoadedEventArgs"/> from <see cref="Windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/>.
/// Creates a <see cref="WebViewControlDOMContentLoadedEventArgs"/> from <see cref="windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlDOMContentLoadedEventArgs"/> instance containing the event data.</param>
/// <returns><see cref="WebViewControlDOMContentLoadedEventArgs"/>.</returns>
public static WebViewControlDOMContentLoadedEventArgs FromWebViewControlDOMContentLoadedEventArgs(
Windows.Web.UI.WebViewControlDOMContentLoadedEventArgs args) =>
windows.Web.UI.WebViewControlDOMContentLoadedEventArgs args) =>
new WebViewControlDOMContentLoadedEventArgs(args);
}
}

Просмотреть файл

@ -17,6 +17,7 @@ using Windows.Web.Http.Headers;
using Windows.Web.UI;
using Windows.Web.UI.Interop;
using Rect = Windows.Foundation.Rect;
using windows = Windows;
// Suppress document warnings as the items are internal and are used to propagate exception info up to consuming classes
#pragma warning disable SA1604 // Element documentation must have summary
@ -203,9 +204,9 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
internal Windows.Web.UI.Interop.WebViewControlProcess Process { get; private set; }
internal windows.Web.UI.Interop.WebViewControlProcess Process { get; private set; }
internal Windows.Web.UI.WebViewControlSettings Settings
internal windows.Web.UI.WebViewControlSettings Settings
{
get
{
@ -456,7 +457,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
internal void MoveFocus(WebViewControlMoveFocusReason reason)
{
_webViewControl?.MoveFocus((Windows.Web.UI.Interop.WebViewControlMoveFocusReason)reason);
_webViewControl?.MoveFocus((windows.Web.UI.Interop.WebViewControlMoveFocusReason)reason);
}
/// <exception cref="ArgumentException">The provided <paramref name="source"/> is a relative URI.</exception>
@ -551,10 +552,10 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
throw new ArgumentNullException(nameof(streamResolver));
}
Windows.Web.IUriToStreamResolver AsWindowsRuntimeUriToStreamResolver(IUriToStreamResolver streamResolverInterop)
windows.Web.IUriToStreamResolver AsWindowsRuntimeUriToStreamResolver(IUriToStreamResolver streamResolverInterop)
{
// Check to see if the stream resolver is actually a wrapper of a WinRT stream resolver
if (streamResolverInterop is Windows.Web.IUriToStreamResolver streamResolverAdapter)
if (streamResolverInterop is windows.Web.IUriToStreamResolver streamResolverAdapter)
{
return streamResolverAdapter;
}
@ -725,7 +726,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnAcceleratorKeyPressed(WebViewControl sender, Windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs args) => OnAcceleratorKeyPressed(args);
private void OnAcceleratorKeyPressed(WebViewControl sender, windows.Web.UI.Interop.WebViewControlAcceleratorKeyPressedEventArgs args) => OnAcceleratorKeyPressed(args);
private void OnContainsFullScreenElementChanged(object args)
{
@ -747,7 +748,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnContentLoading(IWebViewControl sender, Windows.Web.UI.WebViewControlContentLoadingEventArgs args) => OnContentLoading(args);
private void OnContentLoading(IWebViewControl sender, windows.Web.UI.WebViewControlContentLoadingEventArgs args) => OnContentLoading(args);
private void OnDOMContentLoaded(WebViewControlDOMContentLoadedEventArgs args)
{
@ -758,7 +759,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnDOMContentLoaded(IWebViewControl sender, Windows.Web.UI.WebViewControlDOMContentLoadedEventArgs args)
private void OnDOMContentLoaded(IWebViewControl sender, windows.Web.UI.WebViewControlDOMContentLoadedEventArgs args)
{
// When Source set to null or navigating to stream/string, we navigate to "about:blank" internally.
if (NavigatingToAboutBlank)
@ -784,7 +785,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnFrameContentLoading(IWebViewControl sender, Windows.Web.UI.WebViewControlContentLoadingEventArgs args) => OnFrameContentLoading(args);
private void OnFrameContentLoading(IWebViewControl sender, windows.Web.UI.WebViewControlContentLoadingEventArgs args) => OnFrameContentLoading(args);
private void OnFrameDOMContentLoaded(WebViewControlDOMContentLoadedEventArgs args)
{
@ -795,7 +796,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnFrameDOMContentLoaded(IWebViewControl sender, Windows.Web.UI.WebViewControlDOMContentLoadedEventArgs args) => OnFrameDOMContentLoaded(args);
private void OnFrameDOMContentLoaded(IWebViewControl sender, windows.Web.UI.WebViewControlDOMContentLoadedEventArgs args) => OnFrameDOMContentLoaded(args);
private void OnFrameNavigationCompleted(WebViewControlNavigationCompletedEventArgs args)
{
@ -806,7 +807,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnFrameNavigationCompleted(IWebViewControl sender, Windows.Web.UI.WebViewControlNavigationCompletedEventArgs args)
private void OnFrameNavigationCompleted(IWebViewControl sender, windows.Web.UI.WebViewControlNavigationCompletedEventArgs args)
{
// TODO: Need to handle frame navigation like NavigationCompleted?
OnFrameNavigationCompleted(args);
@ -830,7 +831,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnFrameNavigationStarting(IWebViewControl sender, Windows.Web.UI.WebViewControlNavigationStartingEventArgs args) => OnFrameNavigationStarting(args);
private void OnFrameNavigationStarting(IWebViewControl sender, windows.Web.UI.WebViewControlNavigationStartingEventArgs args) => OnFrameNavigationStarting(args);
private void OnGotFocus(IWebViewControl sender, object args) => OnGotFocus(args);
@ -843,7 +844,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnLongRunningScriptDetected(IWebViewControl sender, Windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs args) => OnLongRunningScriptDetected(args);
private void OnLongRunningScriptDetected(IWebViewControl sender, windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs args) => OnLongRunningScriptDetected(args);
private void OnLostFocus(object args)
{
@ -865,7 +866,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnMoveFocusRequested(WebViewControl sender, Windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs args) => OnMoveFocusRequested(args);
private void OnMoveFocusRequested(WebViewControl sender, windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs args) => OnMoveFocusRequested(args);
private void OnNavigationCompleted(WebViewControlNavigationCompletedEventArgs args)
{
@ -882,7 +883,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnNavigationCompleted(IWebViewControl sender, Windows.Web.UI.WebViewControlNavigationCompletedEventArgs args)
private void OnNavigationCompleted(IWebViewControl sender, windows.Web.UI.WebViewControlNavigationCompletedEventArgs args)
{
// When Source set to null or navigating to stream/string, we navigate to "about:blank" internally.
if (NavigatingToAboutBlank)
@ -908,7 +909,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnNavigationStarting(IWebViewControl sender, Windows.Web.UI.WebViewControlNavigationStartingEventArgs args)
private void OnNavigationStarting(IWebViewControl sender, windows.Web.UI.WebViewControlNavigationStartingEventArgs args)
{
var newNavigationRequested = false;
var cancelRequested = false;
@ -986,9 +987,9 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnNewWindowRequested(IWebViewControl sender, Windows.Web.UI.WebViewControlNewWindowRequestedEventArgs args) => OnNewWindowRequested(args);
private void OnNewWindowRequested(IWebViewControl sender, windows.Web.UI.WebViewControlNewWindowRequestedEventArgs args) => OnNewWindowRequested(args);
private void OnOnScriptNotify(IWebViewControl sender, Windows.Web.UI.WebViewControlScriptNotifyEventArgs args) => OnScriptNotify(args);
private void OnOnScriptNotify(IWebViewControl sender, windows.Web.UI.WebViewControlScriptNotifyEventArgs args) => OnScriptNotify(args);
private void OnPermissionRequested(WebViewControlPermissionRequestedEventArgs args)
{
@ -999,7 +1000,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnPermissionRequested(IWebViewControl sender, Windows.Web.UI.WebViewControlPermissionRequestedEventArgs args) => OnPermissionRequested(args);
private void OnPermissionRequested(IWebViewControl sender, windows.Web.UI.WebViewControlPermissionRequestedEventArgs args) => OnPermissionRequested(args);
private void OnProcessExited(object sender, object e)
{
@ -1036,7 +1037,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnUnsupportedUriSchemeIdentified(IWebViewControl sender, Windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs args) => OnUnsupportedUriSchemeIdentified(args);
private void OnUnsupportedUriSchemeIdentified(IWebViewControl sender, windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs args) => OnUnsupportedUriSchemeIdentified(args);
private void OnUnviewableContentIdentified(WebViewControlUnviewableContentIdentifiedEventArgs args)
{
@ -1047,7 +1048,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
}
private void OnUnviewableContentIdentified(IWebViewControl sender, Windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs args) => OnUnviewableContentIdentified(args);
private void OnUnviewableContentIdentified(IWebViewControl sender, windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs args) => OnUnviewableContentIdentified(args);
[SecurityCritical]
private void SubscribeEvents()

Просмотреть файл

@ -4,21 +4,22 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Provides data for the <see cref="IWebView.LongRunningScriptDetected"/> event. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="Windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/>
/// <seealso cref="EventArgs"/>
public sealed class WebViewControlLongRunningScriptDetectedEventArgs : EventArgs
{
[SecurityCritical]
private readonly Windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs _args;
private readonly windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs _args;
internal WebViewControlLongRunningScriptDetectedEventArgs(Windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs args)
internal WebViewControlLongRunningScriptDetectedEventArgs(windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs args)
{
_args = args ?? throw new ArgumentNullException(nameof(args));
}
@ -41,20 +42,20 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/> to <see cref="WebViewControlLongRunningScriptDetectedEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/> to <see cref="WebViewControlLongRunningScriptDetectedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlLongRunningScriptDetectedEventArgs(Windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs args) => ToWebViewControlLongRunningScriptDetectedEventArgs(args);
public static implicit operator WebViewControlLongRunningScriptDetectedEventArgs(windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs args) => ToWebViewControlLongRunningScriptDetectedEventArgs(args);
/// <summary>
/// Creates a <see cref="WebViewControlLongRunningScriptDetectedEventArgs"/> from <see cref="Windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/>.
/// Creates a <see cref="WebViewControlLongRunningScriptDetectedEventArgs"/> from <see cref="windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs"/> instance containing the event data.</param>
/// <returns>WebViewControlLongRunningScriptDetectedEventArgs.</returns>
public static WebViewControlLongRunningScriptDetectedEventArgs
ToWebViewControlLongRunningScriptDetectedEventArgs(
Windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs args) =>
windows.Web.UI.WebViewControlLongRunningScriptDetectedEventArgs args) =>
new WebViewControlLongRunningScriptDetectedEventArgs(args);
}
}

Просмотреть файл

@ -2,13 +2,15 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// An enum that describes the reason for moving the focus.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.Interop.WebViewControlMoveFocusReason"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="Windows.Web.UI.Interop.WebViewControlMoveFocusReason"/>
/// <remarks>Copy from <see cref="windows.Web.UI.Interop.WebViewControlMoveFocusReason"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="windows.Web.UI.Interop.WebViewControlMoveFocusReason"/>
public enum WebViewControlMoveFocusReason
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

Просмотреть файл

@ -4,21 +4,22 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Provides data for the <see cref="IWebView.MoveFocusRequested"/> event. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <remarks>Copy from <see cref="windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="EventArgs" />
/// <seealso cref="Windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/>
/// <seealso cref="windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/>
public sealed class WebViewControlMoveFocusRequestedEventArgs : EventArgs
{
[SecurityCritical]
private readonly Windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs _args;
private readonly windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs _args;
internal WebViewControlMoveFocusRequestedEventArgs(Windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs args)
internal WebViewControlMoveFocusRequestedEventArgs(windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs args)
{
_args = args ?? throw new ArgumentNullException(nameof(args));
}
@ -30,19 +31,19 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public WebViewControlMoveFocusReason Reason => (WebViewControlMoveFocusReason)_args.Reason;
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/> to <see cref="WebViewControlMoveFocusRequestedEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/> to <see cref="WebViewControlMoveFocusRequestedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlMoveFocusRequestedEventArgs(Windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs args) => ToWebViewControlMoveFocusRequestedEventArgs(args);
public static implicit operator WebViewControlMoveFocusRequestedEventArgs(windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs args) => ToWebViewControlMoveFocusRequestedEventArgs(args);
/// <summary>
/// Creates a <see cref="WebViewControlMoveFocusRequestedEventArgs"/> from <see cref="Windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/>.
/// Creates a <see cref="WebViewControlMoveFocusRequestedEventArgs"/> from <see cref="windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs"/> instance containing the event data.</param>
/// <returns><see cref="WebViewControlMoveFocusRequestedEventArgs"/></returns>
public static WebViewControlMoveFocusRequestedEventArgs ToWebViewControlMoveFocusRequestedEventArgs(
Windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs args) =>
windows.Web.UI.Interop.WebViewControlMoveFocusRequestedEventArgs args) =>
new WebViewControlMoveFocusRequestedEventArgs(args);
}
}

Просмотреть файл

@ -5,25 +5,26 @@
using System;
using System.Security;
using System.Windows.Forms;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Provides data for the <see cref="IWebView.NavigationCompleted"/> and <see cref="IWebView.FrameNavigationCompleted"/> events. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="System.EventArgs" />
/// <seealso cref="Windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/>
/// <seealso cref="windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/>
public sealed class WebViewControlNavigationCompletedEventArgs : EventArgs
{
internal WebViewControlNavigationCompletedEventArgs(Windows.Web.UI.WebViewControlNavigationCompletedEventArgs args)
internal WebViewControlNavigationCompletedEventArgs(windows.Web.UI.WebViewControlNavigationCompletedEventArgs args)
{
IsSuccess = args.IsSuccess;
Uri = args.Uri;
WebErrorStatus = (WebErrorStatus)args.WebErrorStatus;
}
internal WebViewControlNavigationCompletedEventArgs(Windows.Web.UI.WebViewControlNavigationCompletedEventArgs args, Uri uri)
internal WebViewControlNavigationCompletedEventArgs(windows.Web.UI.WebViewControlNavigationCompletedEventArgs args, Uri uri)
: this(args)
{
Uri = uri;
@ -63,19 +64,19 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public WebErrorStatus WebErrorStatus { get; }
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/> to <see cref="WebViewControlNavigationCompletedEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/> to <see cref="WebViewControlNavigationCompletedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlNavigationCompletedEventArgs(Windows.Web.UI.WebViewControlNavigationCompletedEventArgs args) => ToWebViewControlNavigationCompletedEventArgs(args);
public static implicit operator WebViewControlNavigationCompletedEventArgs(windows.Web.UI.WebViewControlNavigationCompletedEventArgs args) => ToWebViewControlNavigationCompletedEventArgs(args);
/// <summary>
/// Creates a <see cref="WebViewControlNavigationCompletedEventArgs"/> from <see cref="Windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/>.
/// Creates a <see cref="WebViewControlNavigationCompletedEventArgs"/> from <see cref="windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlNavigationCompletedEventArgs"/> instance containing the event data.</param>
/// <returns><see cref="WebViewControlNavigationCompletedEventArgs"/></returns>
public static WebViewControlNavigationCompletedEventArgs ToWebViewControlNavigationCompletedEventArgs(
Windows.Web.UI.WebViewControlNavigationCompletedEventArgs args) =>
windows.Web.UI.WebViewControlNavigationCompletedEventArgs args) =>
new WebViewControlNavigationCompletedEventArgs(args);
#if WPF
/// <summary>

Просмотреть файл

@ -5,19 +5,20 @@
using System;
using System.Security;
using System.Windows.Forms;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Provides data for the <see cref="IWebView.NavigationStarting"/> and <see cref="IWebView.FrameNavigationStarting"/> events. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlNavigationStartingEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlNavigationStartingEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="System.EventArgs" />
/// <seealso cref="Windows.Web.UI.WebViewControlNavigationStartingEventArgs"/>
/// <seealso cref="windows.Web.UI.WebViewControlNavigationStartingEventArgs"/>
public sealed class WebViewControlNavigationStartingEventArgs : EventArgs
{
[SecurityCritical]
private readonly Windows.Web.UI.WebViewControlNavigationStartingEventArgs _args;
private readonly windows.Web.UI.WebViewControlNavigationStartingEventArgs _args;
#if WPF
[SecurityCritical]
private readonly System.Windows.Navigation.NavigatingCancelEventArgs _wpfArgs;
@ -28,14 +29,14 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
#endif
[SecurityCritical]
internal WebViewControlNavigationStartingEventArgs(Windows.Web.UI.WebViewControlNavigationStartingEventArgs args)
internal WebViewControlNavigationStartingEventArgs(windows.Web.UI.WebViewControlNavigationStartingEventArgs args)
{
_args = args;
Uri = args.Uri;
}
[SecurityCritical]
internal WebViewControlNavigationStartingEventArgs(Windows.Web.UI.WebViewControlNavigationStartingEventArgs args, Uri uri)
internal WebViewControlNavigationStartingEventArgs(windows.Web.UI.WebViewControlNavigationStartingEventArgs args, Uri uri)
: this(args)
{
Uri = uri;
@ -106,19 +107,19 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public Uri Uri { get; }
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlNavigationStartingEventArgs"/> to <see cref="WebViewControlNavigationStartingEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlNavigationStartingEventArgs"/> to <see cref="WebViewControlNavigationStartingEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlNavigationStartingEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlNavigationStartingEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlNavigationStartingEventArgs(Windows.Web.UI.WebViewControlNavigationStartingEventArgs args) => ToWebViewControlNavigationStartingEventArgs(args);
public static implicit operator WebViewControlNavigationStartingEventArgs(windows.Web.UI.WebViewControlNavigationStartingEventArgs args) => ToWebViewControlNavigationStartingEventArgs(args);
/// <summary>
/// Creates a <see cref="WebViewControlNavigationStartingEventArgs"/> from <see cref="Windows.Web.UI.WebViewControlNavigationStartingEventArgs"/>.
/// Creates a <see cref="WebViewControlNavigationStartingEventArgs"/> from <see cref="windows.Web.UI.WebViewControlNavigationStartingEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlNavigationStartingEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlNavigationStartingEventArgs"/> instance containing the event data.</param>
/// <returns><see cref="WebViewControlNavigationStartingEventArgs"/>.</returns>
public static WebViewControlNavigationStartingEventArgs ToWebViewControlNavigationStartingEventArgs(
Windows.Web.UI.WebViewControlNavigationStartingEventArgs args) =>
windows.Web.UI.WebViewControlNavigationStartingEventArgs args) =>
new WebViewControlNavigationStartingEventArgs(args);
#if WPF
/// <summary>

Просмотреть файл

@ -4,21 +4,22 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Provides data for the <see cref="IWebView.NewWindowRequested"/> event. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="System.EventArgs" />
/// <seealso cref="Windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/>
/// <seealso cref="windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/>
public sealed class WebViewControlNewWindowRequestedEventArgs : EventArgs
{
[SecurityCritical]
private readonly Windows.Web.UI.WebViewControlNewWindowRequestedEventArgs _args;
private readonly windows.Web.UI.WebViewControlNewWindowRequestedEventArgs _args;
internal WebViewControlNewWindowRequestedEventArgs(Windows.Web.UI.WebViewControlNewWindowRequestedEventArgs args)
internal WebViewControlNewWindowRequestedEventArgs(windows.Web.UI.WebViewControlNewWindowRequestedEventArgs args)
{
_args = args ?? throw new ArgumentNullException(nameof(args));
}
@ -46,19 +47,19 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/> to <see cref="WebViewControlNewWindowRequestedEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/> to <see cref="WebViewControlNewWindowRequestedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlNewWindowRequestedEventArgs(Windows.Web.UI.WebViewControlNewWindowRequestedEventArgs args) => ToWebViewControlNewWindowRequestedEventArgs(args);
public static implicit operator WebViewControlNewWindowRequestedEventArgs(windows.Web.UI.WebViewControlNewWindowRequestedEventArgs args) => ToWebViewControlNewWindowRequestedEventArgs(args);
/// <summary>
/// Creates a <see cref="WebViewControlNewWindowRequestedEventArgs"/> from <see cref="Windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/>.
/// Creates a <see cref="WebViewControlNewWindowRequestedEventArgs"/> from <see cref="windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlNewWindowRequestedEventArgs"/> instance containing the event data.</param>
/// <returns><see cref="WebViewControlNewWindowRequestedEventArgs"/></returns>
public static WebViewControlNewWindowRequestedEventArgs ToWebViewControlNewWindowRequestedEventArgs(
Windows.Web.UI.WebViewControlNewWindowRequestedEventArgs args) =>
windows.Web.UI.WebViewControlNewWindowRequestedEventArgs args) =>
new WebViewControlNewWindowRequestedEventArgs(args);
}
}

Просмотреть файл

@ -4,6 +4,7 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
@ -11,16 +12,16 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
/// Represents a request for permissions in an <see cref="IWebView"/>. This class cannot be inherited.
/// </summary>
/// <remarks>
/// <p>Copy from <see cref="Windows.Web.UI.WebViewControlPermissionRequest"/> to avoid requirement to link Windows.winmd.</p>
/// <p>Copy from <see cref="windows.Web.UI.WebViewControlPermissionRequest"/> to avoid requirement to link Windows.winmd.</p>
/// <p>For more info, see the <seealso cref="IWebView.PermissionRequested"/> event.</p>
/// </remarks>
/// <seealso cref="IWebView.PermissionRequested"/>
public sealed class WebViewControlPermissionRequest
{
[SecurityCritical]
private readonly Windows.Web.UI.WebViewControlPermissionRequest _permissionRequest;
private readonly windows.Web.UI.WebViewControlPermissionRequest _permissionRequest;
internal WebViewControlPermissionRequest(Windows.Web.UI.WebViewControlPermissionRequest permissionRequest)
internal WebViewControlPermissionRequest(windows.Web.UI.WebViewControlPermissionRequest permissionRequest)
{
_permissionRequest = permissionRequest ?? throw new ArgumentNullException(nameof(permissionRequest));
}
@ -50,19 +51,19 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public Uri Uri => _permissionRequest.Uri;
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlPermissionRequest"/> to <see cref="WebViewControlPermissionRequest"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlPermissionRequest"/> to <see cref="WebViewControlPermissionRequest"/>.
/// </summary>
/// <param name="args">The permission request.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlPermissionRequest(Windows.Web.UI.WebViewControlPermissionRequest args) => ToWebViewControlPermissionRequest(args);
public static implicit operator WebViewControlPermissionRequest(windows.Web.UI.WebViewControlPermissionRequest args) => ToWebViewControlPermissionRequest(args);
/// <summary>
/// Creates a <see cref="WebViewControlPermissionRequest"/> from <see cref="Windows.Web.UI.WebViewControlPermissionRequest"/>.
/// Creates a <see cref="WebViewControlPermissionRequest"/> from <see cref="windows.Web.UI.WebViewControlPermissionRequest"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlPermissionRequest"/>.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlPermissionRequest"/>.</param>
/// <returns><see cref="WebViewControlPermissionRequest"/></returns>
public static WebViewControlPermissionRequest ToWebViewControlPermissionRequest(
Windows.Web.UI.WebViewControlPermissionRequest args) => new WebViewControlPermissionRequest(args);
windows.Web.UI.WebViewControlPermissionRequest args) => new WebViewControlPermissionRequest(args);
/// <summary>
/// Grants the requested permission.

Просмотреть файл

@ -4,21 +4,22 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Provides data for the <see cref="IWebView.PermissionRequested"/> event. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="System.EventArgs" />
/// <seealso cref="Windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/>
/// <seealso cref="windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/>
public sealed class WebViewControlPermissionRequestedEventArgs : EventArgs
{
[SecurityCritical]
private readonly Windows.Web.UI.WebViewControlPermissionRequestedEventArgs _args;
private readonly windows.Web.UI.WebViewControlPermissionRequestedEventArgs _args;
internal WebViewControlPermissionRequestedEventArgs(Windows.Web.UI.WebViewControlPermissionRequestedEventArgs args)
internal WebViewControlPermissionRequestedEventArgs(windows.Web.UI.WebViewControlPermissionRequestedEventArgs args)
{
_args = args;
}
@ -30,19 +31,19 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public WebViewControlPermissionRequest PermissionRequest => _args.PermissionRequest;
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/> to <see cref="WebViewControlPermissionRequestedEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/> to <see cref="WebViewControlPermissionRequestedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlPermissionRequestedEventArgs(Windows.Web.UI.WebViewControlPermissionRequestedEventArgs args) => ToWebViewControlPermissionRequestedEventArgs(args);
public static implicit operator WebViewControlPermissionRequestedEventArgs(windows.Web.UI.WebViewControlPermissionRequestedEventArgs args) => ToWebViewControlPermissionRequestedEventArgs(args);
/// <summary>
/// Creates a <see cref="WebViewControlPermissionRequestedEventArgs"/> from <see cref="Windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/>.
/// Creates a <see cref="WebViewControlPermissionRequestedEventArgs"/> from <see cref="windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlPermissionRequestedEventArgs"/> instance containing the event data.</param>
/// <returns><see cref="WebViewControlPermissionRequestedEventArgs"/></returns>
public static WebViewControlPermissionRequestedEventArgs ToWebViewControlPermissionRequestedEventArgs(
Windows.Web.UI.WebViewControlPermissionRequestedEventArgs args) =>
windows.Web.UI.WebViewControlPermissionRequestedEventArgs args) =>
new WebViewControlPermissionRequestedEventArgs(args);
}
}

Просмотреть файл

@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
// Type is a copy. Information regarding the origination of the type is in summary comments
@ -9,8 +11,8 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
/// <summary>
/// Defines constants that specify the state of a <see cref="IWebView.PermissionRequested"/> event.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlPermissionState"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="Windows.Web.UI.WebViewControlPermissionState"/>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlPermissionState"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="windows.Web.UI.WebViewControlPermissionState"/>
public enum WebViewControlPermissionState
{
Unknown,

Просмотреть файл

@ -2,13 +2,15 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Defines constants that specify the state of a <see cref="IWebView.PermissionRequested"/> event.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlPermissionType"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="Windows.Web.UI.WebViewControlPermissionType"/>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlPermissionType"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="windows.Web.UI.WebViewControlPermissionType"/>
public enum WebViewControlPermissionType
{
/// <summary>

Просмотреть файл

@ -7,16 +7,17 @@ using System.Security;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Foundation.Metadata;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// A proxy for <see cref="Windows.Web.UI.Interop.WebViewControlProcess"/>.
/// A proxy for <see cref="windows.Web.UI.Interop.WebViewControlProcess"/>.
/// </summary>
public sealed class WebViewControlProcess
{
[SecurityCritical]
private readonly Windows.Web.UI.Interop.WebViewControlProcess _process;
private readonly windows.Web.UI.Interop.WebViewControlProcess _process;
/// <summary>
/// Initializes a new instance of the <see cref="WebViewControlProcess"/> class.
@ -31,11 +32,11 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
/// </summary>
/// <param name="processOptions">The process options.</param>
public WebViewControlProcess(WebViewControlProcessOptions processOptions)
: this(new Windows.Web.UI.Interop.WebViewControlProcess(processOptions.ToWinRtWebViewControlProcessOptions()))
: this(new windows.Web.UI.Interop.WebViewControlProcess(processOptions.ToWinRtWebViewControlProcessOptions()))
{
}
private WebViewControlProcess(Windows.Web.UI.Interop.WebViewControlProcess process)
private WebViewControlProcess(windows.Web.UI.Interop.WebViewControlProcess process)
{
_process = process ?? throw new ArgumentNullException(nameof(process));
SubscribeEvents();
@ -66,19 +67,19 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public uint ProcessId => _process.ProcessId;
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.Interop.WebViewControlProcess"/> to <see cref="WebViewControlProcess"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.Interop.WebViewControlProcess"/> to <see cref="WebViewControlProcess"/>.
/// </summary>
/// <param name="process">The process.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlProcess(Windows.Web.UI.Interop.WebViewControlProcess process) => ToWebViewControlProcess(process);
public static implicit operator WebViewControlProcess(windows.Web.UI.Interop.WebViewControlProcess process) => ToWebViewControlProcess(process);
/// <summary>
/// Creates a <see cref="WebViewControlProcess"/> from <see cref="Windows.Web.UI.Interop.WebViewControlProcess"/>.
/// Creates a <see cref="WebViewControlProcess"/> from <see cref="windows.Web.UI.Interop.WebViewControlProcess"/>.
/// </summary>
/// <param name="process">The <see cref="Windows.Web.UI.Interop.WebViewControlProcess"/> instance.</param>
/// <param name="process">The <see cref="windows.Web.UI.Interop.WebViewControlProcess"/> instance.</param>
/// <returns><see cref="WebViewControlProcess"/></returns>
public static WebViewControlProcess ToWebViewControlProcess(
Windows.Web.UI.Interop.WebViewControlProcess process) => new WebViewControlProcess(process);
windows.Web.UI.Interop.WebViewControlProcess process) => new WebViewControlProcess(process);
/// <summary>
/// Terminates the underlying WWAHost process.
@ -97,7 +98,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
return new WebViewControlHost(wvc);
}
private IAsyncOperation<Windows.Web.UI.Interop.WebViewControl> CreateWebViewControlAsync(
private IAsyncOperation<windows.Web.UI.Interop.WebViewControl> CreateWebViewControlAsync(
IntPtr hostWindowHandle,
Rect bounds)
{
@ -106,7 +107,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
[SecurityCritical]
private IAsyncOperation<Windows.Web.UI.Interop.WebViewControl> CreateWebViewControlAsync(
private IAsyncOperation<windows.Web.UI.Interop.WebViewControl> CreateWebViewControlAsync(
long hostWindowHandle,
Rect bounds)
{
@ -119,7 +120,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
return _process.CreateWebViewControlAsync(hostWindowHandle, bounds);
}
private void OnWebViewControlProcessExited(Windows.Web.UI.Interop.WebViewControlProcess sender, object args)
private void OnWebViewControlProcessExited(windows.Web.UI.Interop.WebViewControlProcess sender, object args)
{
var handler = ProcessExited;
if (handler != null)

Просмотреть файл

@ -2,13 +2,15 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Represents the state of the <see cref="WebViewControlProcess"/>.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.Interop.WebViewControlProcessCapabilityState"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="Windows.Web.UI.Interop.WebViewControlProcessCapabilityState"/>
/// <remarks>Copy from <see cref="windows.Web.UI.Interop.WebViewControlProcessCapabilityState"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="windows.Web.UI.Interop.WebViewControlProcessCapabilityState"/>
public enum WebViewControlProcessCapabilityState
{
/// <summary>

Просмотреть файл

@ -4,6 +4,7 @@
using System;
using Windows.Foundation.Metadata;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
@ -11,9 +12,9 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
/// This class contains options that can be set when creating a <see cref="IWebView"/> instance.
/// </summary>
/// <remarks>
/// Copy from <see cref="Windows.Web.UI.Interop.WebViewControlProcessOptions"/> to avoid requirement to link Windows.winmd.
/// Copy from <see cref="windows.Web.UI.Interop.WebViewControlProcessOptions"/> to avoid requirement to link Windows.winmd.
/// </remarks>
/// <seealso cref="Windows.Web.UI.Interop.WebViewControlProcessOptions"/>
/// <seealso cref="windows.Web.UI.Interop.WebViewControlProcessOptions"/>
public sealed class WebViewControlProcessOptions
{
/// <summary>
@ -38,31 +39,31 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.Interop.WebViewControlProcessOptions"/> to <see cref="WebViewControlProcessOptions"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.Interop.WebViewControlProcessOptions"/> to <see cref="WebViewControlProcessOptions"/>.
/// </summary>
/// <param name="options">The options.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlProcessOptions(Windows.Web.UI.Interop.WebViewControlProcessOptions options) => ToWinRtWebViewControlProcessOptions(options);
public static implicit operator WebViewControlProcessOptions(windows.Web.UI.Interop.WebViewControlProcessOptions options) => ToWinRtWebViewControlProcessOptions(options);
public static Windows.Web.UI.Interop.WebViewControlProcessOptions ToWinRtWebViewControlProcessOptions(WebViewControlProcessOptions options)
public static windows.Web.UI.Interop.WebViewControlProcessOptions ToWinRtWebViewControlProcessOptions(WebViewControlProcessOptions options)
{
var retval = new Windows.Web.UI.Interop.WebViewControlProcessOptions();
var retval = new windows.Web.UI.Interop.WebViewControlProcessOptions();
if (!string.IsNullOrEmpty(options?.EnterpriseId) && !StringComparer.InvariantCulture.Equals(retval.EnterpriseId, options?.EnterpriseId))
{
retval.EnterpriseId = options.EnterpriseId;
}
retval.PrivateNetworkClientServerCapability = (Windows.Web.UI.Interop.WebViewControlProcessCapabilityState)options?.PrivateNetworkClientServerCapability;
retval.PrivateNetworkClientServerCapability = (windows.Web.UI.Interop.WebViewControlProcessCapabilityState)options?.PrivateNetworkClientServerCapability;
return retval;
}
/// <summary>
/// Converts this instance to a <seealso cref="Windows.Web.UI.Interop.WebViewControlProcessOptions"/> instance.
/// Converts this instance to a <seealso cref="windows.Web.UI.Interop.WebViewControlProcessOptions"/> instance.
/// </summary>
/// <returns>A <seealso cref="Windows.Web.UI.Interop.WebViewControlProcessOptions"/> instance.</returns>
internal Windows.Web.UI.Interop.WebViewControlProcessOptions ToWinRtWebViewControlProcessOptions()
/// <returns>A <seealso cref="windows.Web.UI.Interop.WebViewControlProcessOptions"/> instance.</returns>
internal windows.Web.UI.Interop.WebViewControlProcessOptions ToWinRtWebViewControlProcessOptions()
{
return ToWinRtWebViewControlProcessOptions(this);
}

Просмотреть файл

@ -4,21 +4,22 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Provides data for the <see cref="IWebView.ScriptNotify"/> event. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlScriptNotifyEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlScriptNotifyEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="System.EventArgs" />
/// <seealso cref="Windows.Web.UI.WebViewControlScriptNotifyEventArgs"/>
/// <seealso cref="windows.Web.UI.WebViewControlScriptNotifyEventArgs"/>
public sealed class WebViewControlScriptNotifyEventArgs : EventArgs
{
[SecurityCritical]
private readonly Windows.Web.UI.WebViewControlScriptNotifyEventArgs _args;
private readonly windows.Web.UI.WebViewControlScriptNotifyEventArgs _args;
internal WebViewControlScriptNotifyEventArgs(Windows.Web.UI.WebViewControlScriptNotifyEventArgs args)
internal WebViewControlScriptNotifyEventArgs(windows.Web.UI.WebViewControlScriptNotifyEventArgs args)
{
_args = args;
}
@ -36,18 +37,18 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public string Value => _args.Value;
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlScriptNotifyEventArgs"/> to <see cref="WebViewControlScriptNotifyEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlScriptNotifyEventArgs"/> to <see cref="WebViewControlScriptNotifyEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlScriptNotifyEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlScriptNotifyEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlScriptNotifyEventArgs(Windows.Web.UI.WebViewControlScriptNotifyEventArgs args) => ToWebViewControlScriptNotifyEventArgs(args);
public static implicit operator WebViewControlScriptNotifyEventArgs(windows.Web.UI.WebViewControlScriptNotifyEventArgs args) => ToWebViewControlScriptNotifyEventArgs(args);
/// <summary>
/// Creates a <see cref="WebViewControlScriptNotifyEventArgs"/> from <see cref="Windows.Web.UI.WebViewControlScriptNotifyEventArgs"/>.
/// Creates a <see cref="WebViewControlScriptNotifyEventArgs"/> from <see cref="windows.Web.UI.WebViewControlScriptNotifyEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlScriptNotifyEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlScriptNotifyEventArgs"/> instance containing the event data.</param>
/// <returns><see cref="WebViewControlScriptNotifyEventArgs"/></returns>
public static WebViewControlScriptNotifyEventArgs ToWebViewControlScriptNotifyEventArgs(
Windows.Web.UI.WebViewControlScriptNotifyEventArgs args) => new WebViewControlScriptNotifyEventArgs(args);
windows.Web.UI.WebViewControlScriptNotifyEventArgs args) => new WebViewControlScriptNotifyEventArgs(args);
}
}

Просмотреть файл

@ -4,19 +4,20 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// A proxy for <see cref="Windows.Web.UI.WebViewControlSettings"/>. This class cannot be inherited.
/// A proxy for <see cref="windows.Web.UI.WebViewControlSettings"/>. This class cannot be inherited.
/// </summary>
/// <seealso cref="Windows.Web.UI.WebViewControlSettings"/>
/// <seealso cref="windows.Web.UI.WebViewControlSettings"/>
public sealed class WebViewControlSettings
{
[SecurityCritical]
private readonly Windows.Web.UI.WebViewControlSettings _settings;
private readonly windows.Web.UI.WebViewControlSettings _settings;
internal WebViewControlSettings(Windows.Web.UI.WebViewControlSettings settings)
internal WebViewControlSettings(windows.Web.UI.WebViewControlSettings settings)
{
_settings = settings ?? throw new ArgumentNullException(nameof(settings));
}
@ -52,18 +53,18 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
}
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlSettings"/> to <see cref="WebViewControlSettings"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlSettings"/> to <see cref="WebViewControlSettings"/>.
/// </summary>
/// <param name="settings">The settings.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlSettings(Windows.Web.UI.WebViewControlSettings settings) => ToWebViewControlSettings(settings);
public static implicit operator WebViewControlSettings(windows.Web.UI.WebViewControlSettings settings) => ToWebViewControlSettings(settings);
/// <summary>
/// Creates a <see cref="WebViewControlSettings" /> from <see cref="Windows.Web.UI.WebViewControlSettings"/>.
/// Creates a <see cref="WebViewControlSettings" /> from <see cref="windows.Web.UI.WebViewControlSettings"/>.
/// </summary>
/// <param name="settings">The settings.</param>
/// <returns><see cref="WebViewControlSettings"/></returns>
public static WebViewControlSettings ToWebViewControlSettings(Windows.Web.UI.WebViewControlSettings settings) =>
public static WebViewControlSettings ToWebViewControlSettings(windows.Web.UI.WebViewControlSettings settings) =>
new WebViewControlSettings(settings);
}
}

Просмотреть файл

@ -4,21 +4,22 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// Provides data for the <see cref="IWebView.UnsupportedUriSchemeIdentified" /> event. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="System.EventArgs" />
/// <seealso cref="Windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/>
/// <seealso cref="windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/>
public sealed class WebViewControlUnsupportedUriSchemeIdentifiedEventArgs : EventArgs
{
[SecurityCritical]
private readonly Windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs _args;
private readonly windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs _args;
internal WebViewControlUnsupportedUriSchemeIdentifiedEventArgs(Windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs args)
internal WebViewControlUnsupportedUriSchemeIdentifiedEventArgs(windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs args)
{
_args = args ?? throw new ArgumentNullException(nameof(args));
}
@ -40,19 +41,19 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public Uri Uri => _args.Uri;
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/> to <see cref="WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/> to <see cref="WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlUnsupportedUriSchemeIdentifiedEventArgs(Windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs args) => ToWebViewControlUnsupportedUriSchemeIdentifiedEventArgs(args);
public static implicit operator WebViewControlUnsupportedUriSchemeIdentifiedEventArgs(windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs args) => ToWebViewControlUnsupportedUriSchemeIdentifiedEventArgs(args);
/// <summary>
/// Creates a <see cref="WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/> from <see cref="Windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/>.
/// Creates a <see cref="WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/> from <see cref="windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/> instance containing the event data.</param>
/// <returns><see cref="WebViewControlUnsupportedUriSchemeIdentifiedEventArgs"/></returns>
public static WebViewControlUnsupportedUriSchemeIdentifiedEventArgs ToWebViewControlUnsupportedUriSchemeIdentifiedEventArgs(
Windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs args) =>
windows.Web.UI.WebViewControlUnsupportedUriSchemeIdentifiedEventArgs args) =>
new WebViewControlUnsupportedUriSchemeIdentifiedEventArgs(args);
}
}

Просмотреть файл

@ -4,22 +4,23 @@
using System;
using System.Security;
using windows = Windows;
namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
{
/// <summary>
/// CProvides data for the <see cref="IWebView.UnviewableContentIdentified" /> event. This class cannot be inherited.
/// </summary>
/// <remarks>Copy from <see cref="Windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <remarks>Copy from <see cref="windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/> to avoid requirement to link Windows.winmd</remarks>
/// <seealso cref="System.EventArgs" />
/// <seealso cref="Windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/>
/// <seealso cref="windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Unviewable", Justification = "Same as WinRT type")]
public sealed class WebViewControlUnviewableContentIdentifiedEventArgs : EventArgs
{
[SecurityCritical]
private readonly Windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs _args;
private readonly windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs _args;
internal WebViewControlUnviewableContentIdentifiedEventArgs(Windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs args)
internal WebViewControlUnviewableContentIdentifiedEventArgs(windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs args)
{
_args = args ?? throw new ArgumentNullException(nameof(args));
}
@ -43,20 +44,20 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT
public string MediaType => _args.MediaType;
/// <summary>
/// Performs an implicit conversion from <see cref="Windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/> to <see cref="WebViewControlUnviewableContentIdentifiedEventArgs"/>.
/// Performs an implicit conversion from <see cref="windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/> to <see cref="WebViewControlUnviewableContentIdentifiedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/> instance containing the event data.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator WebViewControlUnviewableContentIdentifiedEventArgs(Windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs args) => ToWebViewControlUnviewableContentIdentifiedEventArgs(args);
public static implicit operator WebViewControlUnviewableContentIdentifiedEventArgs(windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs args) => ToWebViewControlUnviewableContentIdentifiedEventArgs(args);
/// <summary>
/// Creates a <see cref="WebViewControlUnviewableContentIdentifiedEventArgs"/> from <see cref="Windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/>.
/// Creates a <see cref="WebViewControlUnviewableContentIdentifiedEventArgs"/> from <see cref="windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/>.
/// </summary>
/// <param name="args">The <see cref="Windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/> instance containing the event data.</param>
/// <param name="args">The <see cref="windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs"/> instance containing the event data.</param>
/// <returns><see cref="WebViewControlUnviewableContentIdentifiedEventArgs"/></returns>
public static WebViewControlUnviewableContentIdentifiedEventArgs
ToWebViewControlUnviewableContentIdentifiedEventArgs(
Windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs args) =>
windows.Web.UI.WebViewControlUnviewableContentIdentifiedEventArgs args) =>
new WebViewControlUnviewableContentIdentifiedEventArgs(args);
}
}

Просмотреть файл

@ -13,25 +13,35 @@ namespace Microsoft.Toolkit.Win32.UI.Controls
{
private static SecurityPermission _unmanagedCodePermission;
private static WebBrowserPermission _webBrowserPermission;
private static WebBrowserPermission _webBrowserPermission;
internal static WebBrowserPermission CachedWebBrowserPermission
{
[SecurityCritical]
get
{
{
#if NET462
return _webBrowserPermission ?? (_webBrowserPermission = new WebBrowserPermission(PermissionState.Unrestricted));
#else
// TODO: Fix
return _webBrowserPermission ?? (_webBrowserPermission = new WebBrowserPermission());
#endif
}
}
[SecuritySafeCritical]
internal static bool AppDomainHasPermission(IPermission permissionToCheck)
{
{
#if NET462
var psToCheck = new PermissionSet(PermissionState.None);
psToCheck.AddPermission(permissionToCheck);
return psToCheck.IsSubsetOf(AppDomain.CurrentDomain.PermissionSet);
#else
// TODO: Fix
return true;
#endif
}
[SecuritySafeCritical]
internal static bool CallerAndAppDomainHaveUnrestrictedWebBrowserPermission()
{

Просмотреть файл

@ -28,7 +28,7 @@ steps:
- task: DotNetCoreInstaller@0
inputs:
packageType: 'sdk'
version: '3.0.100-preview-009790'
version: '3.0.100-preview-009990'
displayName: Install Dot Net Core SDK 3.0
- task: DotNetCoreCLI@2
@ -41,7 +41,7 @@ steps:
- script: nbgv cloud
displayName: Set Version
- powershell: .\build\Install-WindowsSdkISO.ps1 17763
- powershell: .\build\Install-WindowsSdkISO.ps1 18298
displayName: Insider SDK
- powershell: .\build\build.ps1 -target=Package

Просмотреть файл

@ -41,6 +41,11 @@ string Version = null;
var inheritDoc = toolsDir + "/InheritDoc/tools/InheritDoc.exe";
var inheritDocExclude = "Foo.*";
DirectoryPath vsLatest = VSWhereLatest(new VSWhereLatestSettings { IncludePrerelease = true });
FilePath msBuildPathX64 = (vsLatest==null)
? null
: vsLatest.CombineWithFilePath("./MSBuild/Current/Bin/amd64/MSBuild.exe");
//////////////////////////////////////////////////////////////////////
// METHODS
//////////////////////////////////////////////////////////////////////
@ -148,7 +153,8 @@ Task("Build")
Information("\nBuilding Solution");
var buildSettings = new MSBuildSettings
{
MaxCpuCount = 0
MaxCpuCount = 0,
ToolPath = msBuildPathX64
}
.SetConfiguration("Release")
.WithTarget("Restore");
@ -160,7 +166,8 @@ Task("Build")
// Build once with normal dependency ordering
buildSettings = new MSBuildSettings
{
MaxCpuCount = 0
MaxCpuCount = 0,
ToolPath = msBuildPathX64
}
.SetConfiguration("Release")
.WithTarget("Build")
@ -205,7 +212,8 @@ Task("Package")
{
// Invoke the pack target in the end
var buildSettings = new MSBuildSettings {
MaxCpuCount = 0
MaxCpuCount = 0,
ToolPath = msBuildPathX64
}
.SetConfiguration("Release")
.WithTarget("Pack")

Просмотреть файл

@ -1,5 +1,5 @@
{
"sdk": {
"version": "3.0.100-preview-009790"
"version": "3.0.100-preview-009990"
}
}

Просмотреть файл

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-core-beta" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
</packageSources>
</configuration>