This commit is contained in:
Jon Thysell (JAUNTY) 2022-01-26 12:27:01 -08:00
Родитель 0640c71d12
Коммит 0d35169d5b
62 изменённых файлов: 16576 добавлений и 16534 удалений

42
.gitattributes поставляемый Normal file
Просмотреть файл

@ -0,0 +1,42 @@
# Auto detect text files and perform LF normalization
* text=auto
# C# files should use CRLF.
*.cs text eol=crlf
# C++ files should use CRLF.
*.c text eol=crlf
*.cpp text eol=crlf
*.h text eol=crlf
*.hpp text eol=crlf
# Force Visual Studio project files (mostly XML) to CRLF
# This helps avoid conflict which occurs when Xmarian/Mac contributors with AutoCRLF=input (or off)
# check in these files as CRLFs, and then Windows contributors with AutoCRLF=true end up checking then
# files in as LFs (due to AutoCRLF=true normalizing CRLF->LF on check-in).
*.sln text eol=crlf
*.csproj text eol=crlf
*.vbproj text eol=crlf
*.fsproj text eol=crlf
*.pyproj text eol=crlf
*.dbproj text eol=crlf
*.vcxproj text eol=crlf
*.shproj text eol=crlf
*.projitems text eol=crlf
*.vcxitems text eol=crlf
*.props text eol=crlf
*.filters text eol=crlf
*.js text eol=lf
*.jsx text eol=lf
*.js text eol=lf
*.ts text eol=lf
*.tsx text eol=lf
*.ps1 text eol=lf
*.yml text eol=lf
.editorconfig text eol=lf
.gitattributes text eol=lf
package.json text eol=lf

184
example/windows/.gitignore поставляемый
Просмотреть файл

@ -1,92 +1,92 @@
*AppPackages*
*BundleArtifacts*
#OS junk files
[Tt]humbs.db
*.DS_Store
#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.[Cc]ache
*.ilk
*.log
*.lib
*.sbr
*.sdf
*.opensdf
*.opendb
*.unsuccessfulbuild
ipch/
[Oo]bj/
[Bb]in
[Dd]ebug*/
[Rr]elease*/
Ankh.NoLoad
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
#MonoDevelop
*.pidb
*.userprefs
#Tooling
_ReSharper*/
*.resharper
[Tt]est[Rr]esult*
*.sass-cache
#Project files
[Bb]uild/
#Subversion files
.svn
# Office Temp Files
~$*
# vim Temp Files
*~
#NuGet
packages/
*.nupkg
#ncrunch
*ncrunch*
*crunch*.local.xml
# visual studio database projects
*.dbmdl
#Test files
*.testsettings
#Other files
*.DotSettings
.vs/
*project.lock.json
#Files generated by the VS build
**/Generated Files/**
*AppPackages*
*BundleArtifacts*
#OS junk files
[Tt]humbs.db
*.DS_Store
#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.[Cc]ache
*.ilk
*.log
*.lib
*.sbr
*.sdf
*.opensdf
*.opendb
*.unsuccessfulbuild
ipch/
[Oo]bj/
[Bb]in
[Dd]ebug*/
[Rr]elease*/
Ankh.NoLoad
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
#MonoDevelop
*.pidb
*.userprefs
#Tooling
_ReSharper*/
*.resharper
[Tt]est[Rr]esult*
*.sass-cache
#Project files
[Bb]uild/
#Subversion files
.svn
# Office Temp Files
~$*
# vim Temp Files
*~
#NuGet
packages/
*.nupkg
#ncrunch
*ncrunch*
*crunch*.local.xml
# visual studio database projects
*.dbmdl
#Test files
*.testsettings
#Other files
*.DotSettings
.vs/
*project.lock.json
#Files generated by the VS build
**/Generated Files/**

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

@ -1,176 +1,176 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
<MinimalCoreWin>true</MinimalCoreWin>
<ProjectGuid>{60d4900d-89a0-403a-a2b7-d52efbe11b0a}</ProjectGuid>
<ProjectName>RuntimeComponent1</ProjectName>
<RootNamespace>RuntimeComponent1</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="PropertySheet.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<WarningLevel>Level4</WarningLevel>
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
<!--Temporarily disable cppwinrt heap enforcement to work around xaml compiler generated std::shared_ptr use -->
<AdditionalOptions Condition="'$(CppWinRTHeapEnforcement)'==''">/DWINRT_NO_MAKE_DETECTION %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>
</DisableSpecificWarnings>
<PreprocessorDefinitions>_WINRT_DLL;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<ModuleDefinitionFile>RuntimeComponent1.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="BlankUserControl.h">
<DependentUpon>BlankUserControl.xaml</DependentUpon>
<SubType>Code</SubType>
</ClInclude>
<ClInclude Include="pch.h" />
<ClInclude Include="Class.h">
<DependentUpon>Class.idl</DependentUpon>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="BlankUserControl.cpp">
<DependentUpon>BlankUserControl.xaml</DependentUpon>
<SubType>Code</SubType>
</ClCompile>
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Class.cpp">
<DependentUpon>Class.idl</DependentUpon>
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
</ItemGroup>
<ItemGroup>
<Midl Include="BlankUserControl.idl">
<DependentUpon>BlankUserControl.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
<Midl Include="Class.idl" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="RuntimeComponent1.def" />
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
<Text Include="readme.txt">
<DeploymentContent>false</DeploymentContent>
</Text>
</ItemGroup>
<ItemGroup>
<Page Include="BlankUserControl.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
<Target Name="Deploy" />
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
<MinimalCoreWin>true</MinimalCoreWin>
<ProjectGuid>{60d4900d-89a0-403a-a2b7-d52efbe11b0a}</ProjectGuid>
<ProjectName>RuntimeComponent1</ProjectName>
<RootNamespace>RuntimeComponent1</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="PropertySheet.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<WarningLevel>Level4</WarningLevel>
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
<!--Temporarily disable cppwinrt heap enforcement to work around xaml compiler generated std::shared_ptr use -->
<AdditionalOptions Condition="'$(CppWinRTHeapEnforcement)'==''">/DWINRT_NO_MAKE_DETECTION %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>
</DisableSpecificWarnings>
<PreprocessorDefinitions>_WINRT_DLL;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<ModuleDefinitionFile>RuntimeComponent1.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="BlankUserControl.h">
<DependentUpon>BlankUserControl.xaml</DependentUpon>
<SubType>Code</SubType>
</ClInclude>
<ClInclude Include="pch.h" />
<ClInclude Include="Class.h">
<DependentUpon>Class.idl</DependentUpon>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="BlankUserControl.cpp">
<DependentUpon>BlankUserControl.xaml</DependentUpon>
<SubType>Code</SubType>
</ClCompile>
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Class.cpp">
<DependentUpon>Class.idl</DependentUpon>
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
</ItemGroup>
<ItemGroup>
<Midl Include="BlankUserControl.idl">
<DependentUpon>BlankUserControl.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
<Midl Include="Class.idl" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="RuntimeComponent1.def" />
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
<Text Include="readme.txt">
<DeploymentContent>false</DeploymentContent>
</Text>
</ItemGroup>
<ItemGroup>
<Page Include="BlankUserControl.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210225.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
<Target Name="Deploy" />
</Project>

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

@ -1,36 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resources">
<UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{926ab91d-31b4-48c3-b9a4-e681349f27f0}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="Class.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<Midl Include="Class.idl" />
</ItemGroup>
<ItemGroup>
<None Include="RuntimeComponent1.def" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
</ItemGroup>
<ItemGroup>
<Text Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<Page Include="BlankUserControl.xaml" />
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resources">
<UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{926ab91d-31b4-48c3-b9a4-e681349f27f0}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="Class.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<Midl Include="Class.idl" />
</ItemGroup>
<ItemGroup>
<None Include="RuntimeComponent1.def" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
</ItemGroup>
<ItemGroup>
<Text Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<Page Include="BlankUserControl.xaml" />
</ItemGroup>
</Project>

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

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.210225.3" targetFramework="native" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.210225.3" targetFramework="native" />
</packages>

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

@ -1,224 +1,224 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29215.179
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example", "example\example.vcxproj", "{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}"
ProjectSection(ProjectDependencies) = postProject
{F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {F7D32BD0-2749-483E-9A0D-1635EF7E3136}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Folly", "..\..\node_modules\react-native-windows\Folly\Folly.vcxproj", "{A990658C-CE31-4BCC-976F-0FC6B1AF693D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmt", "..\..\node_modules\react-native-windows\fmt\fmt.vcxproj", "{14B93DC8-FD93-4A6D-81CB-8BC96644501C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactCommon", "..\..\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj", "{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}"
ProjectSection(ProjectDependencies) = postProject
{A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {A990658C-CE31-4BCC-976F-0FC6B1AF693D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra", "..\..\node_modules\react-native-windows\Chakra\Chakra.vcxitems", "{C38970C0-5FBF-4D69-90D8-CBAC225AE895}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative", "..\..\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj", "{F7D32BD0-2749-483E-9A0D-1635EF7E3136}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Cxx", "..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems", "{DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\..\node_modules\react-native-windows\Common\Common.vcxproj", "{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReactNative", "ReactNative", "{5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Shared", "..\..\node_modules\react-native-windows\Shared\Shared.vcxitems", "{2049DBE9-8D13-42C9-AE4B-413AE38FFFD0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mso", "..\..\node_modules\react-native-windows\Mso\Mso.vcxitems", "{84E05BFA-CBAF-4F0D-BFB6-4CE85742A57E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Include", "..\..\node_modules\react-native-windows\include\Include.vcxitems", "{EF074BA1-2D54-4D49-A28E-5E040B47CD2E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeXaml", "..\..\package\windows\ReactNativeXaml\ReactNativeXaml.vcxproj", "{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Codegen", "..\..\package\Codegen\Codegen.csproj", "{5B4C219B-2178-4226-B5C1-DFAD6919790A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RuntimeComponent1", "RuntimeComponent1\RuntimeComponent1.vcxproj", "{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
..\..\node_modules\react-native-windows\Shared\Shared.vcxitems*{2049dbe9-8d13-42c9-ae4b-413ae38fffd0}*SharedItemsImports = 9
..\..\node_modules\react-native-windows\Mso\Mso.vcxitems*{84e05bfa-cbaf-4f0d-bfb6-4ce85742a57e}*SharedItemsImports = 9
..\..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{c38970c0-5fbf-4d69-90d8-cbac225ae895}*SharedItemsImports = 9
..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9
..\..\node_modules\react-native-windows\include\Include.vcxitems*{ef074ba1-2d54-4d49-a28e-5e040b47cd2e}*SharedItemsImports = 9
..\..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
..\..\node_modules\react-native-windows\Mso\Mso.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
..\..\node_modules\react-native-windows\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|Any CPU.ActiveCfg = Debug|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|ARM64.ActiveCfg = Debug|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|ARM64.Build.0 = Debug|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|ARM64.Deploy.0 = Debug|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x64.ActiveCfg = Debug|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x64.Build.0 = Debug|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x64.Deploy.0 = Debug|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x86.ActiveCfg = Debug|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x86.Build.0 = Debug|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x86.Deploy.0 = Debug|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|Any CPU.ActiveCfg = Release|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|ARM64.ActiveCfg = Release|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|ARM64.Build.0 = Release|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|ARM64.Deploy.0 = Release|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x64.ActiveCfg = Release|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x64.Build.0 = Release|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x64.Deploy.0 = Release|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x86.ActiveCfg = Release|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x86.Build.0 = Release|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x86.Deploy.0 = Release|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|Any CPU.ActiveCfg = Debug|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.Build.0 = Debug|ARM64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.ActiveCfg = Debug|x64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.Build.0 = Debug|x64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.ActiveCfg = Debug|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.Build.0 = Debug|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|Any CPU.ActiveCfg = Release|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.ActiveCfg = Release|ARM64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.Build.0 = Release|ARM64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.ActiveCfg = Release|x64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.Build.0 = Release|x64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.ActiveCfg = Release|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.Build.0 = Release|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|Any CPU.ActiveCfg = Debug|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|ARM64.ActiveCfg = Debug|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|ARM64.Build.0 = Debug|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|ARM64.Deploy.0 = Debug|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x64.ActiveCfg = Debug|x64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x64.Build.0 = Debug|x64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.ActiveCfg = Debug|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.Build.0 = Debug|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.Deploy.0 = Debug|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|Any CPU.ActiveCfg = Release|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|ARM64.ActiveCfg = Release|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|ARM64.Build.0 = Release|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|ARM64.Deploy.0 = Release|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x64.ActiveCfg = Release|x64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x64.Build.0 = Release|x64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.ActiveCfg = Release|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.Build.0 = Release|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.Deploy.0 = Release|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|Any CPU.ActiveCfg = Debug|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.ActiveCfg = Debug|ARM64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.Build.0 = Debug|ARM64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.ActiveCfg = Debug|x64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.Build.0 = Debug|x64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.ActiveCfg = Debug|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.Build.0 = Debug|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|Any CPU.ActiveCfg = Release|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.ActiveCfg = Release|ARM64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.Build.0 = Release|ARM64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.ActiveCfg = Release|x64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.Build.0 = Release|x64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.ActiveCfg = Release|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.Build.0 = Release|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|Any CPU.ActiveCfg = Debug|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.ActiveCfg = Debug|ARM64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.Build.0 = Debug|ARM64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.ActiveCfg = Debug|x64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.Build.0 = Debug|x64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.ActiveCfg = Debug|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.Build.0 = Debug|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|Any CPU.ActiveCfg = Release|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.ActiveCfg = Release|ARM64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.Build.0 = Release|ARM64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.ActiveCfg = Release|x64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.Build.0 = Release|x64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.ActiveCfg = Release|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.Build.0 = Release|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|Any CPU.ActiveCfg = Debug|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.Build.0 = Debug|ARM64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.ActiveCfg = Debug|x64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.Build.0 = Debug|x64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.ActiveCfg = Debug|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.Build.0 = Debug|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|Any CPU.ActiveCfg = Release|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.ActiveCfg = Release|ARM64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.Build.0 = Release|ARM64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.ActiveCfg = Release|x64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.Build.0 = Release|x64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.ActiveCfg = Release|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.Build.0 = Release|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|Any CPU.ActiveCfg = Debug|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM64.ActiveCfg = Debug|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM64.Build.0 = Debug|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x64.ActiveCfg = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x64.Build.0 = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x86.ActiveCfg = Debug|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x86.Build.0 = Debug|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|Any CPU.ActiveCfg = Release|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM64.ActiveCfg = Release|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM64.Build.0 = Release|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x64.ActiveCfg = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x64.Build.0 = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x86.ActiveCfg = Release|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x86.Build.0 = Release|Win32
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|ARM64.Build.0 = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|x64.ActiveCfg = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|x64.Build.0 = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|x86.ActiveCfg = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|x86.Build.0 = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|Any CPU.Build.0 = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|ARM64.ActiveCfg = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|ARM64.Build.0 = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|x64.ActiveCfg = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|x64.Build.0 = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|x86.ActiveCfg = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|x86.Build.0 = Release|Any CPU
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|Any CPU.ActiveCfg = Debug|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|ARM64.ActiveCfg = Debug|ARM64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|ARM64.Build.0 = Debug|ARM64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|x64.ActiveCfg = Debug|x64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|x64.Build.0 = Debug|x64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|x86.ActiveCfg = Debug|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|x86.Build.0 = Debug|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|x86.Deploy.0 = Debug|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|Any CPU.ActiveCfg = Release|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|ARM64.ActiveCfg = Release|ARM64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|ARM64.Build.0 = Release|ARM64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|x64.ActiveCfg = Release|x64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|x64.Build.0 = Release|x64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|x86.ActiveCfg = Release|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|x86.Build.0 = Release|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|x86.Deploy.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{14B93DC8-FD93-4A6D-81CB-8BC96644501C} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{C38970C0-5FBF-4D69-90D8-CBAC225AE895} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{2049DBE9-8D13-42C9-AE4B-413AE38FFFD0} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{84E05BFA-CBAF-4F0D-BFB6-4CE85742A57E} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{EF074BA1-2D54-4D49-A28E-5E040B47CD2E} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D43FAD39-F619-437D-BB40-04A3982ACB6A}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29215.179
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example", "example\example.vcxproj", "{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}"
ProjectSection(ProjectDependencies) = postProject
{F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {F7D32BD0-2749-483E-9A0D-1635EF7E3136}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Folly", "..\..\node_modules\react-native-windows\Folly\Folly.vcxproj", "{A990658C-CE31-4BCC-976F-0FC6B1AF693D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmt", "..\..\node_modules\react-native-windows\fmt\fmt.vcxproj", "{14B93DC8-FD93-4A6D-81CB-8BC96644501C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactCommon", "..\..\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj", "{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}"
ProjectSection(ProjectDependencies) = postProject
{A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {A990658C-CE31-4BCC-976F-0FC6B1AF693D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra", "..\..\node_modules\react-native-windows\Chakra\Chakra.vcxitems", "{C38970C0-5FBF-4D69-90D8-CBAC225AE895}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative", "..\..\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj", "{F7D32BD0-2749-483E-9A0D-1635EF7E3136}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Cxx", "..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems", "{DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\..\node_modules\react-native-windows\Common\Common.vcxproj", "{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReactNative", "ReactNative", "{5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Shared", "..\..\node_modules\react-native-windows\Shared\Shared.vcxitems", "{2049DBE9-8D13-42C9-AE4B-413AE38FFFD0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mso", "..\..\node_modules\react-native-windows\Mso\Mso.vcxitems", "{84E05BFA-CBAF-4F0D-BFB6-4CE85742A57E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Include", "..\..\node_modules\react-native-windows\include\Include.vcxitems", "{EF074BA1-2D54-4D49-A28E-5E040B47CD2E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeXaml", "..\..\package\windows\ReactNativeXaml\ReactNativeXaml.vcxproj", "{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Codegen", "..\..\package\Codegen\Codegen.csproj", "{5B4C219B-2178-4226-B5C1-DFAD6919790A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RuntimeComponent1", "RuntimeComponent1\RuntimeComponent1.vcxproj", "{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
..\..\node_modules\react-native-windows\Shared\Shared.vcxitems*{2049dbe9-8d13-42c9-ae4b-413ae38fffd0}*SharedItemsImports = 9
..\..\node_modules\react-native-windows\Mso\Mso.vcxitems*{84e05bfa-cbaf-4f0d-bfb6-4ce85742a57e}*SharedItemsImports = 9
..\..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{c38970c0-5fbf-4d69-90d8-cbac225ae895}*SharedItemsImports = 9
..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9
..\..\node_modules\react-native-windows\include\Include.vcxitems*{ef074ba1-2d54-4d49-a28e-5e040b47cd2e}*SharedItemsImports = 9
..\..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
..\..\node_modules\react-native-windows\Mso\Mso.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
..\..\node_modules\react-native-windows\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|Any CPU.ActiveCfg = Debug|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|ARM64.ActiveCfg = Debug|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|ARM64.Build.0 = Debug|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|ARM64.Deploy.0 = Debug|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x64.ActiveCfg = Debug|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x64.Build.0 = Debug|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x64.Deploy.0 = Debug|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x86.ActiveCfg = Debug|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x86.Build.0 = Debug|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Debug|x86.Deploy.0 = Debug|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|Any CPU.ActiveCfg = Release|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|ARM64.ActiveCfg = Release|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|ARM64.Build.0 = Release|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|ARM64.Deploy.0 = Release|ARM64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x64.ActiveCfg = Release|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x64.Build.0 = Release|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x64.Deploy.0 = Release|x64
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x86.ActiveCfg = Release|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x86.Build.0 = Release|Win32
{E6A0B072-AB97-4FF3-85FD-E4B877EEB573}.Release|x86.Deploy.0 = Release|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|Any CPU.ActiveCfg = Debug|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.Build.0 = Debug|ARM64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.ActiveCfg = Debug|x64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.Build.0 = Debug|x64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.ActiveCfg = Debug|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.Build.0 = Debug|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|Any CPU.ActiveCfg = Release|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.ActiveCfg = Release|ARM64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.Build.0 = Release|ARM64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.ActiveCfg = Release|x64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.Build.0 = Release|x64
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.ActiveCfg = Release|Win32
{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.Build.0 = Release|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|Any CPU.ActiveCfg = Debug|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|ARM64.ActiveCfg = Debug|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|ARM64.Build.0 = Debug|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|ARM64.Deploy.0 = Debug|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x64.ActiveCfg = Debug|x64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x64.Build.0 = Debug|x64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.ActiveCfg = Debug|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.Build.0 = Debug|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.Deploy.0 = Debug|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|Any CPU.ActiveCfg = Release|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|ARM64.ActiveCfg = Release|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|ARM64.Build.0 = Release|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|ARM64.Deploy.0 = Release|ARM64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x64.ActiveCfg = Release|x64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x64.Build.0 = Release|x64
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.ActiveCfg = Release|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.Build.0 = Release|Win32
{14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.Deploy.0 = Release|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|Any CPU.ActiveCfg = Debug|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.ActiveCfg = Debug|ARM64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.Build.0 = Debug|ARM64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.ActiveCfg = Debug|x64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.Build.0 = Debug|x64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.ActiveCfg = Debug|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.Build.0 = Debug|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|Any CPU.ActiveCfg = Release|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.ActiveCfg = Release|ARM64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.Build.0 = Release|ARM64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.ActiveCfg = Release|x64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.Build.0 = Release|x64
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.ActiveCfg = Release|Win32
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.Build.0 = Release|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|Any CPU.ActiveCfg = Debug|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.ActiveCfg = Debug|ARM64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.Build.0 = Debug|ARM64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.ActiveCfg = Debug|x64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.Build.0 = Debug|x64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.ActiveCfg = Debug|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.Build.0 = Debug|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|Any CPU.ActiveCfg = Release|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.ActiveCfg = Release|ARM64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.Build.0 = Release|ARM64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.ActiveCfg = Release|x64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.Build.0 = Release|x64
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.ActiveCfg = Release|Win32
{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.Build.0 = Release|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|Any CPU.ActiveCfg = Debug|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.Build.0 = Debug|ARM64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.ActiveCfg = Debug|x64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.Build.0 = Debug|x64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.ActiveCfg = Debug|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.Build.0 = Debug|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|Any CPU.ActiveCfg = Release|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.ActiveCfg = Release|ARM64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.Build.0 = Release|ARM64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.ActiveCfg = Release|x64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.Build.0 = Release|x64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.ActiveCfg = Release|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.Build.0 = Release|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|Any CPU.ActiveCfg = Debug|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM64.ActiveCfg = Debug|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM64.Build.0 = Debug|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x64.ActiveCfg = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x64.Build.0 = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x86.ActiveCfg = Debug|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x86.Build.0 = Debug|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|Any CPU.ActiveCfg = Release|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM64.ActiveCfg = Release|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM64.Build.0 = Release|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x64.ActiveCfg = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x64.Build.0 = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x86.ActiveCfg = Release|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x86.Build.0 = Release|Win32
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|ARM64.Build.0 = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|x64.ActiveCfg = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|x64.Build.0 = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|x86.ActiveCfg = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Debug|x86.Build.0 = Debug|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|Any CPU.Build.0 = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|ARM64.ActiveCfg = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|ARM64.Build.0 = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|x64.ActiveCfg = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|x64.Build.0 = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|x86.ActiveCfg = Release|Any CPU
{5B4C219B-2178-4226-B5C1-DFAD6919790A}.Release|x86.Build.0 = Release|Any CPU
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|Any CPU.ActiveCfg = Debug|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|ARM64.ActiveCfg = Debug|ARM64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|ARM64.Build.0 = Debug|ARM64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|x64.ActiveCfg = Debug|x64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|x64.Build.0 = Debug|x64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|x86.ActiveCfg = Debug|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|x86.Build.0 = Debug|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Debug|x86.Deploy.0 = Debug|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|Any CPU.ActiveCfg = Release|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|ARM64.ActiveCfg = Release|ARM64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|ARM64.Build.0 = Release|ARM64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|x64.ActiveCfg = Release|x64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|x64.Build.0 = Release|x64
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|x86.ActiveCfg = Release|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|x86.Build.0 = Release|Win32
{60D4900D-89A0-403A-A2B7-D52EFBE11B0A}.Release|x86.Deploy.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{14B93DC8-FD93-4A6D-81CB-8BC96644501C} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{C38970C0-5FBF-4D69-90D8-CBAC225AE895} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{2049DBE9-8D13-42C9-AE4B-413AE38FFFD0} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{84E05BFA-CBAF-4F0D-BFB6-4CE85742A57E} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
{EF074BA1-2D54-4D49-A28E-5E040B47CD2E} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D43FAD39-F619-437D-BB40-04A3982ACB6A}
EndGlobalSection
EndGlobal

2
example/windows/example/.gitignore поставляемый
Просмотреть файл

@ -1 +1 @@
/Bundle
/Bundle

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

@ -1,80 +1,80 @@
#include "pch.h"
#include "App.h"
#include "AutolinkedNativeModules.g.h"
#include "ReactPackageProvider.h"
using namespace winrt::example;
using namespace winrt::example::implementation;
using namespace winrt;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Navigation;
using namespace Windows::ApplicationModel;
/// <summary>
/// Initializes the singleton application object. This is the first line of
/// authored code executed, and as such is the logical equivalent of main() or
/// WinMain().
/// </summary>
App::App() noexcept
{
InstanceSettings().UseJsi(true);
#if BUNDLE
JavaScriptBundleFile(L"index.windows");
InstanceSettings().UseWebDebugger(false);
InstanceSettings().UseFastRefresh(false);
#else
JavaScriptBundleFile(L"index");
InstanceSettings().UseWebDebugger(false);
InstanceSettings().UseFastRefresh(true);
#endif
#if _DEBUG
InstanceSettings().UseDeveloperSupport(true);
#else
InstanceSettings().UseDeveloperSupport(false);
#endif
RegisterAutolinkedNativeModulePackages(PackageProviders()); // Includes any autolinked modules
PackageProviders().Append(make<ReactPackageProvider>()); // Includes all modules in this project
InitializeComponent();
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
void App::OnLaunched(activation::LaunchActivatedEventArgs const& e)
{
super::OnLaunched(e);
Frame rootFrame = Window::Current().Content().as<Frame>();
rootFrame.Navigate(xaml_typename<example::MainPage>(), box_value(e.Arguments()));
}
/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
void App::OnSuspending([[maybe_unused]] IInspectable const& sender, [[maybe_unused]] SuspendingEventArgs const& e)
{
// Save application state and stop any background activity
}
/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void App::OnNavigationFailed(IInspectable const&, NavigationFailedEventArgs const& e)
{
throw hresult_error(E_FAIL, hstring(L"Failed to load Page ") + e.SourcePageType().Name);
}
#include "pch.h"
#include "App.h"
#include "AutolinkedNativeModules.g.h"
#include "ReactPackageProvider.h"
using namespace winrt::example;
using namespace winrt::example::implementation;
using namespace winrt;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Navigation;
using namespace Windows::ApplicationModel;
/// <summary>
/// Initializes the singleton application object. This is the first line of
/// authored code executed, and as such is the logical equivalent of main() or
/// WinMain().
/// </summary>
App::App() noexcept
{
InstanceSettings().UseJsi(true);
#if BUNDLE
JavaScriptBundleFile(L"index.windows");
InstanceSettings().UseWebDebugger(false);
InstanceSettings().UseFastRefresh(false);
#else
JavaScriptBundleFile(L"index");
InstanceSettings().UseWebDebugger(false);
InstanceSettings().UseFastRefresh(true);
#endif
#if _DEBUG
InstanceSettings().UseDeveloperSupport(true);
#else
InstanceSettings().UseDeveloperSupport(false);
#endif
RegisterAutolinkedNativeModulePackages(PackageProviders()); // Includes any autolinked modules
PackageProviders().Append(make<ReactPackageProvider>()); // Includes all modules in this project
InitializeComponent();
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
void App::OnLaunched(activation::LaunchActivatedEventArgs const& e)
{
super::OnLaunched(e);
Frame rootFrame = Window::Current().Content().as<Frame>();
rootFrame.Navigate(xaml_typename<example::MainPage>(), box_value(e.Arguments()));
}
/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
void App::OnSuspending([[maybe_unused]] IInspectable const& sender, [[maybe_unused]] SuspendingEventArgs const& e)
{
// Save application state and stop any background activity
}
/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void App::OnNavigationFailed(IInspectable const&, NavigationFailedEventArgs const& e)
{
throw hresult_error(E_FAIL, hstring(L"Failed to load Page ") + e.SourcePageType().Name);
}

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

@ -1,18 +1,18 @@
#pragma once
#include "App.xaml.g.h"
namespace activation = winrt::Windows::ApplicationModel::Activation;
namespace winrt::example::implementation
{
struct App : AppT<App>
{
App() noexcept;
void OnLaunched(activation::LaunchActivatedEventArgs const&);
void OnSuspending(IInspectable const&, Windows::ApplicationModel::SuspendingEventArgs const&);
void OnNavigationFailed(IInspectable const&, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const&);
private:
using super = AppT<App>;
};
} // namespace winrt::example::implementation
#pragma once
#include "App.xaml.g.h"
namespace activation = winrt::Windows::ApplicationModel::Activation;
namespace winrt::example::implementation
{
struct App : AppT<App>
{
App() noexcept;
void OnLaunched(activation::LaunchActivatedEventArgs const&);
void OnSuspending(IInspectable const&, Windows::ApplicationModel::SuspendingEventArgs const&);
void OnNavigationFailed(IInspectable const&, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const&);
private:
using super = AppT<App>;
};
} // namespace winrt::example::implementation

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

@ -1,3 +1,3 @@
namespace example
{
}
namespace example
{
}

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

@ -1,10 +1,10 @@
<react:ReactApplication
x:Class="example.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:example"
xmlns:react="using:Microsoft.ReactNative">
<Application.Resources>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
</Application.Resources>
</react:ReactApplication>
<react:ReactApplication
x:Class="example.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:example"
xmlns:react="using:Microsoft.ReactNative">
<Application.Resources>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
</Application.Resources>
</react:ReactApplication>

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

@ -1,18 +1,18 @@
// AutolinkedNativeModules.g.cpp contents generated by "react-native autolink-windows"
// clang-format off
#include "pch.h"
#include "AutolinkedNativeModules.g.h"
// Includes from react-native-xaml
#include <winrt/ReactNativeXaml.h>
namespace winrt::Microsoft::ReactNative
{
void RegisterAutolinkedNativeModulePackages(winrt::Windows::Foundation::Collections::IVector<winrt::Microsoft::ReactNative::IReactPackageProvider> const& packageProviders)
{
// IReactPackageProviders from react-native-xaml
packageProviders.Append(winrt::ReactNativeXaml::ReactPackageProvider());
}
}
// AutolinkedNativeModules.g.cpp contents generated by "react-native autolink-windows"
// clang-format off
#include "pch.h"
#include "AutolinkedNativeModules.g.h"
// Includes from react-native-xaml
#include <winrt/ReactNativeXaml.h>
namespace winrt::Microsoft::ReactNative
{
void RegisterAutolinkedNativeModulePackages(winrt::Windows::Foundation::Collections::IVector<winrt::Microsoft::ReactNative::IReactPackageProvider> const& packageProviders)
{
// IReactPackageProviders from react-native-xaml
packageProviders.Append(winrt::ReactNativeXaml::ReactPackageProvider());
}
}

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

@ -1,10 +1,10 @@
// AutolinkedNativeModules.g.h contents generated by "react-native autolink-windows"
// clang-format off
#pragma once
namespace winrt::Microsoft::ReactNative
{
void RegisterAutolinkedNativeModulePackages(winrt::Windows::Foundation::Collections::IVector<winrt::Microsoft::ReactNative::IReactPackageProvider> const& packageProviders);
}
// AutolinkedNativeModules.g.h contents generated by "react-native autolink-windows"
// clang-format off
#pragma once
namespace winrt::Microsoft::ReactNative
{
void RegisterAutolinkedNativeModulePackages(winrt::Windows::Foundation::Collections::IVector<winrt::Microsoft::ReactNative::IReactPackageProvider> const& packageProviders);
}

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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- AutolinkedNativeModules.g.props contents generated by "react-native autolink-windows" -->
<PropertyGroup>
</PropertyGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- AutolinkedNativeModules.g.props contents generated by "react-native autolink-windows" -->
<PropertyGroup>
</PropertyGroup>
</Project>

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

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- AutolinkedNativeModules.g.targets contents generated by "react-native autolink-windows" -->
<ItemGroup>
<!-- Projects from react-native-xaml -->
<ProjectReference Include="$(ProjectDir)..\..\..\package\windows\ReactNativeXaml\ReactNativeXaml.vcxproj">
<Project>{0ff7027a-222c-4ffb-8f17-91d18bbaf7a8}</Project>
</ProjectReference>
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- AutolinkedNativeModules.g.targets contents generated by "react-native autolink-windows" -->
<ItemGroup>
<!-- Projects from react-native-xaml -->
<ProjectReference Include="$(ProjectDir)..\..\..\package\windows\ReactNativeXaml\ReactNativeXaml.vcxproj">
<Project>{0ff7027a-222c-4ffb-8f17-91d18bbaf7a8}</Project>
</ProjectReference>
</ItemGroup>
</Project>

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

@ -1,20 +1,20 @@
#include "pch.h"
#include "MainPage.h"
#if __has_include("MainPage.g.cpp")
#include "MainPage.g.cpp"
#endif
#include "App.h"
using namespace winrt;
using namespace Windows::UI::Xaml;
namespace winrt::example::implementation
{
MainPage::MainPage()
{
InitializeComponent();
auto app = Application::Current().as<App>();
ReactRootView().ReactNativeHost(app->Host());
}
}
#include "pch.h"
#include "MainPage.h"
#if __has_include("MainPage.g.cpp")
#include "MainPage.g.cpp"
#endif
#include "App.h"
using namespace winrt;
using namespace Windows::UI::Xaml;
namespace winrt::example::implementation
{
MainPage::MainPage()
{
InitializeComponent();
auto app = Application::Current().as<App>();
ReactRootView().ReactNativeHost(app->Host());
}
}

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

@ -1,19 +1,19 @@
#pragma once
#include "MainPage.g.h"
#include <winrt/Microsoft.ReactNative.h>
namespace winrt::example::implementation
{
struct MainPage : MainPageT<MainPage>
{
MainPage();
};
}
namespace winrt::example::factory_implementation
{
struct MainPage : MainPageT<MainPage, implementation::MainPage>
{
};
}
#pragma once
#include "MainPage.g.h"
#include <winrt/Microsoft.ReactNative.h>
namespace winrt::example::implementation
{
struct MainPage : MainPageT<MainPage>
{
MainPage();
};
}
namespace winrt::example::factory_implementation
{
struct MainPage : MainPageT<MainPage, implementation::MainPage>
{
};
}

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

@ -1,8 +1,8 @@
namespace example
{
[default_interface]
runtimeclass MainPage : Windows.UI.Xaml.Controls.Page
{
MainPage();
}
}
namespace example
{
[default_interface]
runtimeclass MainPage : Windows.UI.Xaml.Controls.Page
{
MainPage();
}
}

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

@ -1,16 +1,16 @@
<Page
x:Class="example.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:example"
xmlns:react="using:Microsoft.ReactNative"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<react:ReactRootView
x:Name="ReactRootView"
ComponentName="example"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
MinHeight="400"/>
</Page>
<Page
x:Class="example.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:example"
xmlns:react="using:Microsoft.ReactNative"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<react:ReactRootView
x:Name="ReactRootView"
ComponentName="example"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
MinHeight="400"/>
</Page>

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

@ -1,50 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">
<Identity
Name="ReactNativeXaml-Example"
Publisher="CN=Alexander Sklar"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="b8e4a7e8-1936-4213-a3b7-afd09481400c" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>example</DisplayName>
<PublisherDisplayName>asklar</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application
Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="example.App">
<uap:VisualElements
DisplayName="example"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="example"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">
<Identity
Name="ReactNativeXaml-Example"
Publisher="CN=Alexander Sklar"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="b8e4a7e8-1936-4213-a3b7-afd09481400c" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>example</DisplayName>
<PublisherDisplayName>asklar</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application
Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="example.App">
<uap:VisualElements
DisplayName="example"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="example"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

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

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<!--
To customize common C++/WinRT project properties:
* right-click the project node
* expand the Common Properties item
* select the C++/WinRT property page
For more advanced scenarios, and complete documentation, please see:
https://github.com/Microsoft/xlang/tree/master/src/package/cppwinrt/nuget
-->
<PropertyGroup />
<ItemDefinitionGroup />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<!--
To customize common C++/WinRT project properties:
* right-click the project node
* expand the Common Properties item
* select the C++/WinRT property page
For more advanced scenarios, and complete documentation, please see:
https://github.com/Microsoft/xlang/tree/master/src/package/cppwinrt/nuget
-->
<PropertyGroup />
<ItemDefinitionGroup />
</Project>

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

@ -1,15 +1,15 @@
#include "pch.h"
#include "ReactPackageProvider.h"
#include "NativeModules.h"
using namespace winrt::Microsoft::ReactNative;
namespace winrt::example::implementation
{
void ReactPackageProvider::CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept
{
AddAttributedModules(packageBuilder);
}
} // namespace winrt::example::implementation
#include "pch.h"
#include "ReactPackageProvider.h"
#include "NativeModules.h"
using namespace winrt::Microsoft::ReactNative;
namespace winrt::example::implementation
{
void ReactPackageProvider::CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept
{
AddAttributedModules(packageBuilder);
}
} // namespace winrt::example::implementation

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

@ -1,13 +1,13 @@
#pragma once
#include "winrt/Microsoft.ReactNative.h"
namespace winrt::example::implementation
{
struct ReactPackageProvider : winrt::implements<ReactPackageProvider, winrt::Microsoft::ReactNative::IReactPackageProvider>
{
public: // IReactPackageProvider
void CreatePackage(winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder) noexcept;
};
} // namespace winrt::example::implementation
#pragma once
#include "winrt/Microsoft.ReactNative.h"
namespace winrt::example::implementation
{
struct ReactPackageProvider : winrt::implements<ReactPackageProvider, winrt::Microsoft::ReactNative::IReactPackageProvider>
{
public: // IReactPackageProvider
void CreatePackage(winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder) noexcept;
};
} // namespace winrt::example::implementation

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

@ -1,201 +1,201 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="16.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="$(SolutionDir)\ExperimentalFeatures.props" Condition="Exists('$(SolutionDir)\ExperimentalFeatures.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<MinimalCoreWin>true</MinimalCoreWin>
<ProjectGuid>{e6a0b072-ab97-4ff3-85fd-e4b877eeb573}</ProjectGuid>
<ProjectName>example</ProjectName>
<RootNamespace>example</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.16299.0</WindowsTargetPlatformMinVersion>
<PackageCertificateKeyFile>example_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>87DD44555FB234D7077BD01D014A68A310E2BDDF</PackageCertificateThumbprint>
<PackageCertificatePassword>password</PackageCertificatePassword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="ReactNativeWindowsProps">
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="ReactNativeWindowsPropertySheets">
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\external\Microsoft.ReactNative.Uwp.CppApp.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.props')" />
<Import Project="$(SolutionDir)\packages\$(WinUIPackageProps)" Condition="'$(WinUIPackageProps)'!='' And Exists('$(SolutionDir)\packages\$(WinUIPackageProps)')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<WarningLevel>Level4</WarningLevel>
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="MainPage.h">
<DependentUpon>MainPage.xaml</DependentUpon>
<SubType>Code</SubType>
</ClInclude>
<ClInclude Include="ReactPackageProvider.h" />
<ClInclude Include="AutolinkedNativeModules.g.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="App.h">
<DependentUpon>App.xaml</DependentUpon>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<SubType>Designer</SubType>
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Image Include="Assets\LockScreenLogo.scale-200.png" />
<Image Include="Assets\SplashScreen.scale-200.png" />
<Image Include="Assets\Square150x150Logo.scale-200.png" />
<Image Include="Assets\Square44x44Logo.scale-200.png" />
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Image Include="Assets\StoreLogo.png" />
<Image Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="MainPage.cpp">
<DependentUpon>MainPage.xaml</DependentUpon>
<SubType>Code</SubType>
</ClCompile>
<ClCompile Include="ReactPackageProvider.cpp" />
<ClCompile Include="AutolinkedNativeModules.g.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="App.cpp">
<DependentUpon>App.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
</ItemGroup>
<ItemGroup>
<Midl Include="App.idl">
<DependentUpon>App.xaml</DependentUpon>
</Midl>
<Midl Include="MainPage.idl">
<DependentUpon>MainPage.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
</ItemGroup>
<ItemGroup>
<None Include="..\..\App.tsx" />
<None Include="..\..\index.js" />
<None Include="example_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="PropertySheet.props" />
<Text Include="readme.txt">
<DeploymentContent>false</DeploymentContent>
</Text>
</ItemGroup>
<ItemGroup>
<Page Include="MainPage.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ReactNativeWindowsTargets">
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets')" />
</ImportGroup>
<Target Name="EnsureReactNativeWindowsTargets" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references targets in your node_modules\react-native-windows folder that are missing. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.props'))" />
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets'))" />
</Target>
<ImportGroup Label="ExtensionTargets">
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets" Condition="Exists('$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets'))" />
</Target>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="16.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="$(SolutionDir)\ExperimentalFeatures.props" Condition="Exists('$(SolutionDir)\ExperimentalFeatures.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<MinimalCoreWin>true</MinimalCoreWin>
<ProjectGuid>{e6a0b072-ab97-4ff3-85fd-e4b877eeb573}</ProjectGuid>
<ProjectName>example</ProjectName>
<RootNamespace>example</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.16299.0</WindowsTargetPlatformMinVersion>
<PackageCertificateKeyFile>example_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>87DD44555FB234D7077BD01D014A68A310E2BDDF</PackageCertificateThumbprint>
<PackageCertificatePassword>password</PackageCertificatePassword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="ReactNativeWindowsProps">
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="ReactNativeWindowsPropertySheets">
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\external\Microsoft.ReactNative.Uwp.CppApp.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.props')" />
<Import Project="$(SolutionDir)\packages\$(WinUIPackageProps)" Condition="'$(WinUIPackageProps)'!='' And Exists('$(SolutionDir)\packages\$(WinUIPackageProps)')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<WarningLevel>Level4</WarningLevel>
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="MainPage.h">
<DependentUpon>MainPage.xaml</DependentUpon>
<SubType>Code</SubType>
</ClInclude>
<ClInclude Include="ReactPackageProvider.h" />
<ClInclude Include="AutolinkedNativeModules.g.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="App.h">
<DependentUpon>App.xaml</DependentUpon>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<SubType>Designer</SubType>
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Image Include="Assets\LockScreenLogo.scale-200.png" />
<Image Include="Assets\SplashScreen.scale-200.png" />
<Image Include="Assets\Square150x150Logo.scale-200.png" />
<Image Include="Assets\Square44x44Logo.scale-200.png" />
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Image Include="Assets\StoreLogo.png" />
<Image Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="MainPage.cpp">
<DependentUpon>MainPage.xaml</DependentUpon>
<SubType>Code</SubType>
</ClCompile>
<ClCompile Include="ReactPackageProvider.cpp" />
<ClCompile Include="AutolinkedNativeModules.g.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="App.cpp">
<DependentUpon>App.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
</ItemGroup>
<ItemGroup>
<Midl Include="App.idl">
<DependentUpon>App.xaml</DependentUpon>
</Midl>
<Midl Include="MainPage.idl">
<DependentUpon>MainPage.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
</ItemGroup>
<ItemGroup>
<None Include="..\..\App.tsx" />
<None Include="..\..\index.js" />
<None Include="example_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="PropertySheet.props" />
<Text Include="readme.txt">
<DeploymentContent>false</DeploymentContent>
</Text>
</ItemGroup>
<ItemGroup>
<Page Include="MainPage.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ReactNativeWindowsTargets">
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets')" />
</ImportGroup>
<Target Name="EnsureReactNativeWindowsTargets" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references targets in your node_modules\react-native-windows folder that are missing. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.props'))" />
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets'))" />
</Target>
<ImportGroup Label="ExtensionTargets">
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets" Condition="Exists('$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets'))" />
</Target>
</Project>

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

@ -1,73 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ApplicationDefinition Include="App.xaml" />
</ItemGroup>
<ItemGroup>
<Midl Include="App.idl" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="App.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="ReactPackageProvider.cpp" />
<ClCompile Include="AutolinkedNativeModules.g.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="App.h" />
<ClInclude Include="ReactPackageProvider.h" />
<ClInclude Include="AutolinkedNativeModules.g.h" />
</ItemGroup>
<ItemGroup>
<Image Include="Assets\Wide310x150Logo.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\StoreLogo.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square150x150Logo.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\SplashScreen.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\LockScreenLogo.scale-200.png">
<Filter>Assets</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest" />
</ItemGroup>
<ItemGroup>
<Filter Include="Assets">
<UniqueIdentifier>{e48dc53e-40b1-40cb-970a-f89935452892}</UniqueIdentifier>
</Filter>
<Filter Include="JS">
<UniqueIdentifier>{2443e9bf-f217-47b5-b226-8ee99297c961}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
<None Include="packages.config" />
<None Include="..\..\App.tsx">
<Filter>JS</Filter>
</None>
<None Include="..\..\index.js">
<Filter>JS</Filter>
</None>
<None Include="example_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Text Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<Page Include="MainPage.xaml" />
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ApplicationDefinition Include="App.xaml" />
</ItemGroup>
<ItemGroup>
<Midl Include="App.idl" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="App.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="ReactPackageProvider.cpp" />
<ClCompile Include="AutolinkedNativeModules.g.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="App.h" />
<ClInclude Include="ReactPackageProvider.h" />
<ClInclude Include="AutolinkedNativeModules.g.h" />
</ItemGroup>
<ItemGroup>
<Image Include="Assets\Wide310x150Logo.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\StoreLogo.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square150x150Logo.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\Square44x44Logo.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\SplashScreen.scale-200.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\LockScreenLogo.scale-200.png">
<Filter>Assets</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest" />
</ItemGroup>
<ItemGroup>
<Filter Include="Assets">
<UniqueIdentifier>{e48dc53e-40b1-40cb-970a-f89935452892}</UniqueIdentifier>
</Filter>
<Filter Include="JS">
<UniqueIdentifier>{2443e9bf-f217-47b5-b226-8ee99297c961}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
<None Include="packages.config" />
<None Include="..\..\App.tsx">
<Filter>JS</Filter>
</None>
<None Include="..\..\index.js">
<Filter>JS</Filter>
</None>
<None Include="example_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Text Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<Page Include="MainPage.xaml" />
</ItemGroup>
</Project>

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

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.UI.Xaml" version="2.6.0" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.210629.4" targetFramework="native" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.UI.Xaml" version="2.6.0" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.210629.4" targetFramework="native" />
</packages>

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

@ -1 +1 @@
#include "pch.h"
#include "pch.h"

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

@ -1,27 +1,27 @@
#pragma once
#define NOMINMAX
#include <hstring.h>
#include <restrictederrorinfo.h>
#include <unknwn.h>
#include <windows.h>
#include <winrt/Windows.ApplicationModel.Activation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Data.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Navigation.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Microsoft.ReactNative.h>
#include <winrt/Microsoft.UI.Xaml.Automation.Peers.h>
#include <winrt/Microsoft.UI.Xaml.Controls.Primitives.h>
#include <winrt/Microsoft.UI.Xaml.Controls.h>
#include <winrt/Microsoft.UI.Xaml.Media.h>
#include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
using namespace winrt::Windows::Foundation;
#pragma once
#define NOMINMAX
#include <hstring.h>
#include <restrictederrorinfo.h>
#include <unknwn.h>
#include <windows.h>
#include <winrt/Windows.ApplicationModel.Activation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Data.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Windows.UI.Xaml.Markup.h>
#include <winrt/Windows.UI.Xaml.Navigation.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Microsoft.ReactNative.h>
#include <winrt/Microsoft.UI.Xaml.Automation.Peers.h>
#include <winrt/Microsoft.UI.Xaml.Controls.Primitives.h>
#include <winrt/Microsoft.UI.Xaml.Controls.h>
#include <winrt/Microsoft.UI.Xaml.Media.h>
#include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
using namespace winrt::Windows::Foundation;

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

@ -1,107 +1,107 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "examplenuget", "examplenuget\examplenuget.vcxproj", "{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeXaml", "..\..\package\windows\ReactNativeXaml\ReactNativeXaml.vcxproj", "{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Codegen", "..\..\package\Codegen\Codegen.csproj", "{A9EBFB79-DB42-4839-B369-EFA601A98706}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|Any CPU.ActiveCfg = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|Any CPU.Build.0 = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|Any CPU.Deploy.0 = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM.ActiveCfg = Debug|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM.Build.0 = Debug|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM.Deploy.0 = Debug|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM64.ActiveCfg = Debug|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM64.Build.0 = Debug|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM64.Deploy.0 = Debug|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x64.ActiveCfg = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x64.Build.0 = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x64.Deploy.0 = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x86.ActiveCfg = Debug|Win32
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x86.Build.0 = Debug|Win32
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x86.Deploy.0 = Debug|Win32
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|Any CPU.ActiveCfg = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|Any CPU.Build.0 = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|Any CPU.Deploy.0 = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM.ActiveCfg = Release|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM.Build.0 = Release|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM.Deploy.0 = Release|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM64.ActiveCfg = Release|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM64.Build.0 = Release|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM64.Deploy.0 = Release|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x64.ActiveCfg = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x64.Build.0 = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x64.Deploy.0 = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x86.ActiveCfg = Release|Win32
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x86.Build.0 = Release|Win32
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x86.Deploy.0 = Release|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|Any CPU.ActiveCfg = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|Any CPU.Build.0 = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|Any CPU.Deploy.0 = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM.ActiveCfg = Debug|ARM
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM.Build.0 = Debug|ARM
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM64.ActiveCfg = Debug|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM64.Build.0 = Debug|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x64.ActiveCfg = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x64.Build.0 = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x64.Deploy.0 = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x86.ActiveCfg = Debug|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x86.Build.0 = Debug|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|Any CPU.ActiveCfg = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|Any CPU.Build.0 = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|Any CPU.Deploy.0 = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM.ActiveCfg = Release|ARM
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM.Build.0 = Release|ARM
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM64.ActiveCfg = Release|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM64.Build.0 = Release|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x64.ActiveCfg = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x64.Build.0 = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x64.Deploy.0 = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x86.ActiveCfg = Release|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x86.Build.0 = Release|Win32
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|ARM.ActiveCfg = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|ARM.Build.0 = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|ARM64.Build.0 = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|x64.ActiveCfg = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|x64.Build.0 = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|x86.ActiveCfg = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|x86.Build.0 = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|Any CPU.Build.0 = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|ARM.ActiveCfg = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|ARM.Build.0 = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|ARM64.ActiveCfg = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|ARM64.Build.0 = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|x64.ActiveCfg = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|x64.Build.0 = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|x86.ActiveCfg = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D43FAD39-F619-437D-BB40-04A3982ACB6A}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "examplenuget", "examplenuget\examplenuget.vcxproj", "{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeXaml", "..\..\package\windows\ReactNativeXaml\ReactNativeXaml.vcxproj", "{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Codegen", "..\..\package\Codegen\Codegen.csproj", "{A9EBFB79-DB42-4839-B369-EFA601A98706}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|Any CPU.ActiveCfg = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|Any CPU.Build.0 = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|Any CPU.Deploy.0 = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM.ActiveCfg = Debug|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM.Build.0 = Debug|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM.Deploy.0 = Debug|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM64.ActiveCfg = Debug|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM64.Build.0 = Debug|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|ARM64.Deploy.0 = Debug|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x64.ActiveCfg = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x64.Build.0 = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x64.Deploy.0 = Debug|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x86.ActiveCfg = Debug|Win32
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x86.Build.0 = Debug|Win32
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Debug|x86.Deploy.0 = Debug|Win32
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|Any CPU.ActiveCfg = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|Any CPU.Build.0 = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|Any CPU.Deploy.0 = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM.ActiveCfg = Release|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM.Build.0 = Release|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM.Deploy.0 = Release|ARM
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM64.ActiveCfg = Release|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM64.Build.0 = Release|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|ARM64.Deploy.0 = Release|ARM64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x64.ActiveCfg = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x64.Build.0 = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x64.Deploy.0 = Release|x64
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x86.ActiveCfg = Release|Win32
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x86.Build.0 = Release|Win32
{0E5E86FE-DB24-4DB3-96CF-5F97DA8558F1}.Release|x86.Deploy.0 = Release|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|Any CPU.ActiveCfg = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|Any CPU.Build.0 = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|Any CPU.Deploy.0 = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM.ActiveCfg = Debug|ARM
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM.Build.0 = Debug|ARM
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM64.ActiveCfg = Debug|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|ARM64.Build.0 = Debug|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x64.ActiveCfg = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x64.Build.0 = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x64.Deploy.0 = Debug|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x86.ActiveCfg = Debug|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Debug|x86.Build.0 = Debug|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|Any CPU.ActiveCfg = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|Any CPU.Build.0 = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|Any CPU.Deploy.0 = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM.ActiveCfg = Release|ARM
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM.Build.0 = Release|ARM
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM64.ActiveCfg = Release|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|ARM64.Build.0 = Release|ARM64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x64.ActiveCfg = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x64.Build.0 = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x64.Deploy.0 = Release|x64
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x86.ActiveCfg = Release|Win32
{0FF7027A-222C-4FFB-8F17-91D18BBAF7A8}.Release|x86.Build.0 = Release|Win32
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|ARM.ActiveCfg = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|ARM.Build.0 = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|ARM64.Build.0 = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|x64.ActiveCfg = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|x64.Build.0 = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|x86.ActiveCfg = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Debug|x86.Build.0 = Debug|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|Any CPU.Build.0 = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|ARM.ActiveCfg = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|ARM.Build.0 = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|ARM64.ActiveCfg = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|ARM64.Build.0 = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|x64.ActiveCfg = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|x64.Build.0 = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|x86.ActiveCfg = Release|Any CPU
{A9EBFB79-DB42-4839-B369-EFA601A98706}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D43FAD39-F619-437D-BB40-04A3982ACB6A}
EndGlobalSection
EndGlobal

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

@ -1,123 +1,123 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<None Remove="Windows.UI.Xaml.json" />
</ItemGroup>
<ItemGroup>
<Content Include="Windows.UI.Xaml.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="TypeEnums.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TypeEnums.tt</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="MikeHillberg.MiddleweightReflection" Version="1.0.3" />
<PackageReference Include="System.CodeDom" Version="6.0.0-preview.1.21102.12" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<ItemGroup>
<Compile Update="EventArgsTypeProperties.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>EventArgsTypeProperties.tt</DependentUpon>
</Compile>
<Compile Update="TSEnums.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TSEnums.tt</DependentUpon>
</Compile>
<Compile Update="TSProps.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TSProps.tt</DependentUpon>
</Compile>
<Compile Update="TypeCreator.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TypeCreator.tt</DependentUpon>
</Compile>
<Compile Update="TypeEnums.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TypeEnums.tt</DependentUpon>
</Compile>
<Compile Update="TypeEvents.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TypeEvents.tt</DependentUpon>
</Compile>
<Compile Update="TypeProperties.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TypeProperties.tt</DependentUpon>
</Compile>
<Compile Update="TSTypes.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TSTypes.tt</DependentUpon>
</Compile>
<Compile Update="VersionHeader.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>VersionHeader.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="EventArgsTypeProperties.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>EventArgsTypeProperties.cs</LastGenOutput>
</None>
<None Update="TSEnums.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TSEnums.cs</LastGenOutput>
</None>
<None Update="TSProps.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TSProps.cs</LastGenOutput>
</None>
<None Update="TypeCreator.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TypeCreator.cs</LastGenOutput>
</None>
<None Update="TypeEnums.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TypeEnums.cs</LastGenOutput>
</None>
<None Update="TypeEvents.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TypeEvents.cs</LastGenOutput>
</None>
<None Update="TypeProperties.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TypeProperties.cs</LastGenOutput>
</None>
<None Update="TSTypes.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TSTypes.cs</LastGenOutput>
</None>
<None Update="VersionHeader.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>VersionHeader.cs</LastGenOutput>
</None>
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<None Remove="Windows.UI.Xaml.json" />
</ItemGroup>
<ItemGroup>
<Content Include="Windows.UI.Xaml.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="TypeEnums.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TypeEnums.tt</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="MikeHillberg.MiddleweightReflection" Version="1.0.3" />
<PackageReference Include="System.CodeDom" Version="6.0.0-preview.1.21102.12" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<ItemGroup>
<Compile Update="EventArgsTypeProperties.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>EventArgsTypeProperties.tt</DependentUpon>
</Compile>
<Compile Update="TSEnums.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TSEnums.tt</DependentUpon>
</Compile>
<Compile Update="TSProps.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TSProps.tt</DependentUpon>
</Compile>
<Compile Update="TypeCreator.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TypeCreator.tt</DependentUpon>
</Compile>
<Compile Update="TypeEnums.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TypeEnums.tt</DependentUpon>
</Compile>
<Compile Update="TypeEvents.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TypeEvents.tt</DependentUpon>
</Compile>
<Compile Update="TypeProperties.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TypeProperties.tt</DependentUpon>
</Compile>
<Compile Update="TSTypes.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TSTypes.tt</DependentUpon>
</Compile>
<Compile Update="VersionHeader.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>VersionHeader.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="EventArgsTypeProperties.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>EventArgsTypeProperties.cs</LastGenOutput>
</None>
<None Update="TSEnums.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TSEnums.cs</LastGenOutput>
</None>
<None Update="TSProps.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TSProps.cs</LastGenOutput>
</None>
<None Update="TypeCreator.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TypeCreator.cs</LastGenOutput>
</None>
<None Update="TypeEnums.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TypeEnums.cs</LastGenOutput>
</None>
<None Update="TypeEvents.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TypeEvents.cs</LastGenOutput>
</None>
<None Update="TypeProperties.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TypeProperties.cs</LastGenOutput>
</None>
<None Update="TSTypes.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>TSTypes.cs</LastGenOutput>
</None>
<None Update="VersionHeader.tt">
<Generator>TextTemplatingFilePreprocessor</Generator>
<LastGenOutput>VersionHeader.cs</LastGenOutput>
</None>
</ItemGroup>
</Project>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,61 +1,61 @@
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
#pragma once
#include "pch.h"
#include "XamlMetadata.h"
#include "Crc32Str.h"
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var ns in Properties.Select(p => p.DeclaringType.GetNamespace()).Distinct()) { #>
#include <winrt/<#= ns #>.h>
<# } #>
struct EventArgsProperty {
const char* const name;
using isType_t = bool (*) (const winrt::Windows::Foundation::IInspectable& ea);
const isType_t isType;
using getter_t = winrt::Windows::Foundation::IInspectable (*) (const winrt::Windows::Foundation::IInspectable& ea);
const getter_t getter;
};
const EventArgsProperty eventArgsProperties[] = {
<# foreach (var prop in Properties) {
if (prop.Property != null) { #>
{ "<#= Util.ToJsName(prop.Name) #>", IsType<<#= Util.GetCppWinRTType(prop.DeclaringType) #>>, [](const winrt::Windows::Foundation::IInspectable& obj) { auto ea = obj.as<<#= Util.GetCppWinRTType(prop.DeclaringType) #>>(); return <#= Util.MaybeBox("ea", prop.Property) #>; } },
<# } else { #>
{ "<#= Util.ToJsName(prop.Name) #>", IsType<<#= Util.GetCppWinRTType(prop.DeclaringType) #>>, [](const winrt::Windows::Foundation::IInspectable& obj) { auto ea = obj.as<<#= Util.GetCppWinRTType(prop.DeclaringType) #>>(); return Get<#= prop.Name #>_<#= prop.DeclaringType.GetName() #>(); },
<#} #>
<# } #>
};
struct EventArgsMethod {
const char* const name;
using isType_t = bool (*) (const winrt::Windows::Foundation::IInspectable& ea);
const isType_t isType;
using getter_t = facebook::jsi::Value(*) (facebook::jsi::Runtime& rt, std::shared_ptr<XamlObject> thisVal, const facebook::jsi::Value* args, size_t count);
const getter_t getter;
};
<# foreach (var t in Util.eventArgsMethods) {
foreach (var m in t.Value) {
#>
facebook::jsi::Value <#= t.Key.Replace(".", "_") #>_<#= m #>(facebook::jsi::Runtime& rt, std::shared_ptr<XamlObject> thisVal, const facebook::jsi::Value* args, size_t count);
<# } } #>
const EventArgsMethod eventArgsMethods[] = {
<# foreach (var t in Util.eventArgsMethods) {
foreach (var m in t.Value) {
#>
{ "<#= m #>", IsType<<#= Util.GetCppWinRTType(t.Key) #>>, <#= t.Key.Replace(".", "_") #>_<#= m #> },
<# } } #>
};
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
#pragma once
#include "pch.h"
#include "XamlMetadata.h"
#include "Crc32Str.h"
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var ns in Properties.Select(p => p.DeclaringType.GetNamespace()).Distinct()) { #>
#include <winrt/<#= ns #>.h>
<# } #>
struct EventArgsProperty {
const char* const name;
using isType_t = bool (*) (const winrt::Windows::Foundation::IInspectable& ea);
const isType_t isType;
using getter_t = winrt::Windows::Foundation::IInspectable (*) (const winrt::Windows::Foundation::IInspectable& ea);
const getter_t getter;
};
const EventArgsProperty eventArgsProperties[] = {
<# foreach (var prop in Properties) {
if (prop.Property != null) { #>
{ "<#= Util.ToJsName(prop.Name) #>", IsType<<#= Util.GetCppWinRTType(prop.DeclaringType) #>>, [](const winrt::Windows::Foundation::IInspectable& obj) { auto ea = obj.as<<#= Util.GetCppWinRTType(prop.DeclaringType) #>>(); return <#= Util.MaybeBox("ea", prop.Property) #>; } },
<# } else { #>
{ "<#= Util.ToJsName(prop.Name) #>", IsType<<#= Util.GetCppWinRTType(prop.DeclaringType) #>>, [](const winrt::Windows::Foundation::IInspectable& obj) { auto ea = obj.as<<#= Util.GetCppWinRTType(prop.DeclaringType) #>>(); return Get<#= prop.Name #>_<#= prop.DeclaringType.GetName() #>(); },
<#} #>
<# } #>
};
struct EventArgsMethod {
const char* const name;
using isType_t = bool (*) (const winrt::Windows::Foundation::IInspectable& ea);
const isType_t isType;
using getter_t = facebook::jsi::Value(*) (facebook::jsi::Runtime& rt, std::shared_ptr<XamlObject> thisVal, const facebook::jsi::Value* args, size_t count);
const getter_t getter;
};
<# foreach (var t in Util.eventArgsMethods) {
foreach (var m in t.Value) {
#>
facebook::jsi::Value <#= t.Key.Replace(".", "_") #>_<#= m #>(facebook::jsi::Runtime& rt, std::shared_ptr<XamlObject> thisVal, const facebook::jsi::Value* args, size_t count);
<# } } #>
const EventArgsMethod eventArgsMethods[] = {
<# foreach (var t in Util.eventArgsMethods) {
foreach (var m in t.Value) {
#>
{ "<#= m #>", IsType<<#= Util.GetCppWinRTType(t.Key) #>>, <#= t.Key.Replace(".", "_") #>_<#= m #> },
<# } } #>
};

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

@ -107,9 +107,9 @@ namespace Codegen
}
return n1 == n2;
} else if (that is MrType t1 && other is MrType t2)
{
return t1.GetFullName() == t2.GetFullName();
} else if (that is MrType t1 && other is MrType t2)
{
return t1.GetFullName() == t2.GetFullName();
}
return that.GetName() == other.GetName();
}
@ -136,10 +136,10 @@ namespace Codegen
public string TS { get; set; }
}
public class Command
{
public string Name { get; set; }
public string TSArgTypes { get; set; }
public class Command
{
public string Name { get; set; }
public string TSArgTypes { get; set; }
}
public partial class VersionHeader

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,8 +1,8 @@
{
"profiles": {
"Codegen": {
"commandName": "Project",
"commandLineArgs": "-verbose -winmd ..\\..\\..\\..\\..\\example\\windows\\packages\\Microsoft.UI.Xaml.2.6.0\\lib\\uap10.0\\Microsoft.UI.Xaml.winmd"
}
}
{
"profiles": {
"Codegen": {
"commandName": "Project",
"commandLineArgs": "-verbose -winmd ..\\..\\..\\..\\..\\example\\windows\\packages\\Microsoft.UI.Xaml.2.6.0\\lib\\uap10.0\\Microsoft.UI.Xaml.winmd"
}
}
}

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

@ -16,21 +16,21 @@ namespace Codegen
public string SimpleNameForJs
{
get
{
if (Property != null)
{
string fullPropertyName = Property.DeclaringType.GetFullName() + "." + Property.GetName();
if (Util.propNameMap.TryGetValue(fullPropertyName, out string realName))
{
return realName.Substring(realName.LastIndexOf('.') + 1);
{
if (Property != null)
{
string fullPropertyName = Property.DeclaringType.GetFullName() + "." + Property.GetName();
if (Util.propNameMap.TryGetValue(fullPropertyName, out string realName))
{
return realName.Substring(realName.LastIndexOf('.') + 1);
}
else if (Util.IsDependencyProperty(Property))
{
return Property.DeclaringType.GetName() + SimpleName;
else if (Util.IsDependencyProperty(Property))
{
return Property.DeclaringType.GetName() + SimpleName;
}
}
return SimpleName;
}
return SimpleName;
}
}

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

@ -1,438 +1,438 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class TSEnums : TSEnumsBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("\r\n/*************************************************************\r\nTHIS FILE WAS A" +
"UTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n********************************" +
"******************************/\r\n\r\n");
#line 11 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var enumType in Util.enumsToGenerateConvertersFor) {
var ns = Util.GetTSNamespace(enumType);
if (ns != "") {
#line default
#line hidden
this.Write("export namespace ");
#line 14 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write("Enums {\r\n");
#line 15 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("export enum ");
#line 16 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(enumType)));
#line default
#line hidden
this.Write(" {\r\n");
#line 17 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var value in enumType.GetFields().Skip(1)) {
#line default
#line hidden
this.Write(" ");
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.GetName()));
#line default
#line hidden
this.Write(" = ");
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture((int)value.GetConstantValue(out System.Reflection.Metadata.ConstantTypeCode typeCode)));
#line default
#line hidden
this.Write(",\r\n");
#line 19 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("}\r\n");
#line 20 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
if (ns != "") {
#line default
#line hidden
this.Write("}\r\n\r\n");
#line 23 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
#line 24 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("\r\n\r\n");
#line 27 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var enumType in Util.fakeEnums) {
#line default
#line hidden
this.Write("export enum ");
#line 28 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumType.Name));
#line default
#line hidden
this.Write(" {\r\n");
#line 29 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var value in enumType.Values) {
#line default
#line hidden
this.Write(" ");
#line 30 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Key));
#line default
#line hidden
this.Write(" = ");
#line 30 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Value));
#line default
#line hidden
this.Write(",\r\n");
#line 31 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("}\r\n\r\n");
#line 34 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class TSEnumsBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class TSEnums : TSEnumsBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("\r\n/*************************************************************\r\nTHIS FILE WAS A" +
"UTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n********************************" +
"******************************/\r\n\r\n");
#line 11 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var enumType in Util.enumsToGenerateConvertersFor) {
var ns = Util.GetTSNamespace(enumType);
if (ns != "") {
#line default
#line hidden
this.Write("export namespace ");
#line 14 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write("Enums {\r\n");
#line 15 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("export enum ");
#line 16 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(enumType)));
#line default
#line hidden
this.Write(" {\r\n");
#line 17 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var value in enumType.GetFields().Skip(1)) {
#line default
#line hidden
this.Write(" ");
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.GetName()));
#line default
#line hidden
this.Write(" = ");
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture((int)value.GetConstantValue(out System.Reflection.Metadata.ConstantTypeCode typeCode)));
#line default
#line hidden
this.Write(",\r\n");
#line 19 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("}\r\n");
#line 20 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
if (ns != "") {
#line default
#line hidden
this.Write("}\r\n\r\n");
#line 23 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
#line 24 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("\r\n\r\n");
#line 27 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var enumType in Util.fakeEnums) {
#line default
#line hidden
this.Write("export enum ");
#line 28 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumType.Name));
#line default
#line hidden
this.Write(" {\r\n");
#line 29 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
foreach (var value in enumType.Values) {
#line default
#line hidden
this.Write(" ");
#line 30 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Key));
#line default
#line hidden
this.Write(" = ");
#line 30 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Value));
#line default
#line hidden
this.Write(",\r\n");
#line 31 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
this.Write("}\r\n\r\n");
#line 34 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TSEnums.tt"
}
#line default
#line hidden
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class TSEnumsBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}

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

@ -1,34 +1,34 @@
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var enumType in Util.enumsToGenerateConvertersFor) {
var ns = Util.GetTSNamespace(enumType);
if (ns != "") { #>
export namespace <#= ns #>Enums {
<# } #>
export enum <#= Util.ToJsName(enumType) #> {
<# foreach (var value in enumType.GetFields().Skip(1)) { #>
<#= value.GetName() #> = <#= (int)value.GetConstantValue(out System.Reflection.Metadata.ConstantTypeCode typeCode) #>,
<# } #>}
<# if (ns != "") { #>
}
<# } #>
<# } #>
<# foreach (var enumType in Util.fakeEnums) { #>
export enum <#= enumType.Name #> {
<# foreach (var value in enumType.Values) { #>
<#= value.Key #> = <#= value.Value #>,
<# } #>
}
<# } #>
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var enumType in Util.enumsToGenerateConvertersFor) {
var ns = Util.GetTSNamespace(enumType);
if (ns != "") { #>
export namespace <#= ns #>Enums {
<# } #>
export enum <#= Util.ToJsName(enumType) #> {
<# foreach (var value in enumType.GetFields().Skip(1)) { #>
<#= value.GetName() #> = <#= (int)value.GetConstantValue(out System.Reflection.Metadata.ConstantTypeCode typeCode) #>,
<# } #>}
<# if (ns != "") { #>
}
<# } #>
<# } #>
<# foreach (var enumType in Util.fakeEnums) { #>
export enum <#= enumType.Name #> {
<# foreach (var value in enumType.Values) { #>
<#= value.Key #> = <#= value.Value #>,
<# } #>
}
<# } #>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,100 +1,100 @@
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
import type { ViewProps, NativeSyntheticEvent, ColorValue } from 'react-native';
import type * as Enums from './Enums';
export type Thickness = number | { left?: number, top?: number, right?: number, bottom?: number };
export type GridLength = number | '*' | 'auto' | `${number}*`;
export type CornerRadius = number | { topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number};
export type Point = { x: number, y: number };
export type Color = { a: number, r: number, g: number, b: number };
export type TypedEvent<TArgs> = {
sender: any;
args: TArgs;
}
<# foreach (var t in Util.eventArgsTypes) {
var ns = Util.GetTSNamespace(t);
if (ns != "") { #>
export namespace <#= ns #> {
<# } #>
export type <#= Util.ToJsName(t) #> = {
<# foreach (var m in Util.GetEventArgsMethods(t.GetFullName())) { #>
<#= m #>(<#= Util.GetEventArgsMethodArgs(t, m) #>): <#= Util.GetEventArgsMethodReturnType(t, m) #>
<# }
foreach (var prop in t.GetProperties().Where(p => Util.IsInstanceProperty(p))) {
var tsType = Util.GetTypeScriptType(prop);
if (tsType != "any") {
#>
readonly <#= Util.ToJsName(prop) #>: <#= tsType #>;
<#
}
}
#>
}
<# if (ns != "") { #>
}
<# } #>
<# } #>
<# var derived = Util.GetDerivedTypes(Types);
foreach (var type in Types) { #>
<# var ns = Util.GetTSNamespace(type);
if (ns != "") { #>
export namespace Native<#= ns #> {
<# } #>
export interface Native<#= Util.ToJsName(type) #>Props extends <#= Util.GetBaseClassProps(type) #> {
<# var typeProp = Util.GetJsTypeProperty(type, derived);
if (typeProp != "") { #>
type: <#= typeProp #>;
<# }
foreach (var prop in type.GetProperties().Where(p => Util.ShouldEmitPropertyMetadata(p))) { #>
<#= Util.ToJsName(prop) #>?: <#= Util.GetTypeScriptType(prop) #>;
<# }
foreach (var prop in FakeProps.Where(p => type == p.DeclaringType)) { #>
<#= Util.ToJsName(prop) #>?: <#= Util.GetTypeScriptType(prop) #>; // synthetic property
<# }
foreach (var prop in SyntheticProps.Where(p => type == p.DeclaringType)) { #>
/**
* <#= prop.Comment #>
*/
<#= Util.ToJsName(prop.Name) #>?: <#= Util.GetTypeScriptType(prop) #>; // synthetic property
<# }
foreach (var attachedDP in Util.AttachedProperties.Where(p => Properties.Any(sp => sp.Property == p && sp.DeclaringType == type))) {#>
<#= Util.ToJsName(attachedDP) #>?: <#= Util.GetTypeScriptType(attachedDP) #>; // attached property
<# }
foreach (var evt in type.GetEvents()) { #>
on<#= evt.GetName() #>?: (event: NativeSyntheticEvent<<#= Util.GetEventArgsTSName(evt) #>>) => void;
<# }
foreach (var evt in SyntheticEvents.Where(e => type == e.DeclaringType)) { #>
on<#= evt.Name #>?: (event: NativeSyntheticEvent<<#= Util.GetTypeScriptType(evt) #>>) => void;
<# } #>
}
<# if (ns != "") { #>
}
<# } #>
<# } #>
export type XamlControlProps =<# var first = true; foreach (var type in Types) {
if (Util.HasCtor(type) || !type.IsSealed) {
if (!first) #> | <# ;
first = false;
#> <#= Util.GetNativePropsName(type) #>
<# }
} #>;
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
import type { ViewProps, NativeSyntheticEvent, ColorValue } from 'react-native';
import type * as Enums from './Enums';
export type Thickness = number | { left?: number, top?: number, right?: number, bottom?: number };
export type GridLength = number | '*' | 'auto' | `${number}*`;
export type CornerRadius = number | { topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number};
export type Point = { x: number, y: number };
export type Color = { a: number, r: number, g: number, b: number };
export type TypedEvent<TArgs> = {
sender: any;
args: TArgs;
}
<# foreach (var t in Util.eventArgsTypes) {
var ns = Util.GetTSNamespace(t);
if (ns != "") { #>
export namespace <#= ns #> {
<# } #>
export type <#= Util.ToJsName(t) #> = {
<# foreach (var m in Util.GetEventArgsMethods(t.GetFullName())) { #>
<#= m #>(<#= Util.GetEventArgsMethodArgs(t, m) #>): <#= Util.GetEventArgsMethodReturnType(t, m) #>
<# }
foreach (var prop in t.GetProperties().Where(p => Util.IsInstanceProperty(p))) {
var tsType = Util.GetTypeScriptType(prop);
if (tsType != "any") {
#>
readonly <#= Util.ToJsName(prop) #>: <#= tsType #>;
<#
}
}
#>
}
<# if (ns != "") { #>
}
<# } #>
<# } #>
<# var derived = Util.GetDerivedTypes(Types);
foreach (var type in Types) { #>
<# var ns = Util.GetTSNamespace(type);
if (ns != "") { #>
export namespace Native<#= ns #> {
<# } #>
export interface Native<#= Util.ToJsName(type) #>Props extends <#= Util.GetBaseClassProps(type) #> {
<# var typeProp = Util.GetJsTypeProperty(type, derived);
if (typeProp != "") { #>
type: <#= typeProp #>;
<# }
foreach (var prop in type.GetProperties().Where(p => Util.ShouldEmitPropertyMetadata(p))) { #>
<#= Util.ToJsName(prop) #>?: <#= Util.GetTypeScriptType(prop) #>;
<# }
foreach (var prop in FakeProps.Where(p => type == p.DeclaringType)) { #>
<#= Util.ToJsName(prop) #>?: <#= Util.GetTypeScriptType(prop) #>; // synthetic property
<# }
foreach (var prop in SyntheticProps.Where(p => type == p.DeclaringType)) { #>
/**
* <#= prop.Comment #>
*/
<#= Util.ToJsName(prop.Name) #>?: <#= Util.GetTypeScriptType(prop) #>; // synthetic property
<# }
foreach (var attachedDP in Util.AttachedProperties.Where(p => Properties.Any(sp => sp.Property == p && sp.DeclaringType == type))) {#>
<#= Util.ToJsName(attachedDP) #>?: <#= Util.GetTypeScriptType(attachedDP) #>; // attached property
<# }
foreach (var evt in type.GetEvents()) { #>
on<#= evt.GetName() #>?: (event: NativeSyntheticEvent<<#= Util.GetEventArgsTSName(evt) #>>) => void;
<# }
foreach (var evt in SyntheticEvents.Where(e => type == e.DeclaringType)) { #>
on<#= evt.Name #>?: (event: NativeSyntheticEvent<<#= Util.GetTypeScriptType(evt) #>>) => void;
<# } #>
}
<# if (ns != "") { #>
}
<# } #>
<# } #>
export type XamlControlProps =<# var first = true; foreach (var type in Types) {
if (Util.HasCtor(type) || !type.IsSealed) {
if (!first) #> | <# ;
first = false;
#> <#= Util.GetNativePropsName(type) #>
<# }
} #>;

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

@ -1,491 +1,491 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class TSTypes : TSTypesBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("\r\n/*************************************************************\r\nTHIS FILE WAS A" +
"UTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n********************************" +
"******************************/\r\n\r\nimport type {\r\n");
#line 12 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
foreach (var type in Types.Where(t => Util.HasCtor(t) && Util.GetTSNamespace(t) == "")) {
#line default
#line hidden
this.Write(" ");
#line 13 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetNativePropsName(type)));
#line default
#line hidden
this.Write(",\r\n");
#line 14 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
this.Write("} from \'./Props\';\r\n\r\n");
#line 17 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
foreach (var ns in Types.Where(t => Util.HasCtor(t) && Util.GetTSNamespace(t) != "").Select(t => Util.GetTSNamespace(t)).Distinct()) {
#line default
#line hidden
this.Write("import type { Native");
#line 18 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(" } from \'./Props\';\r\n");
#line 19 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
this.Write(@"
import React from 'react';
import { NativeXamlControl } from './NativeXamlControl';
import { findNodeHandle, UIManager } from 'react-native';
import type { Point } from './Props';
const xamlCommands = UIManager.getViewManagerConfig('XamlControl').Commands;
");
#line 29 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
foreach (var type in Types.Where(t => Util.HasCtor(t))) {
var ns = Util.GetTSNamespace(type);
if (ns != "") {
#line default
#line hidden
this.Write("export namespace ");
#line 33 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(" {\r\n");
#line 34 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
this.Write("export type ");
#line 35 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write("Props = Omit<");
#line 35 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetNativePropsName(type)));
#line default
#line hidden
this.Write(", \'type\'>;\r\n\r\nexport class ");
#line 37 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write(" extends React.Component<");
#line 37 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write("Props> {\r\n render() {\r\n return <NativeXamlControl {...this.props} type=\'");
#line 39 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(type.GetFullName()));
#line default
#line hidden
this.Write("\' />;\r\n }\r\n");
#line 41 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
foreach (var command in Util.GetCommands(type.GetFullName())) {
#line default
#line hidden
this.Write(" static ");
#line 42 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(command.Name));
#line default
#line hidden
this.Write("(ref: React.MutableRefObject<");
#line 42 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write(">, args: ");
#line 42 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(command.TSArgTypes != null ? command.TSArgTypes : "any[]"));
#line default
#line hidden
this.Write(") {\r\n const tag = findNodeHandle(ref.current);\r\n UIManager.dispatchViewMana" +
"gerCommand(tag, xamlCommands.");
#line 44 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(command.Name));
#line default
#line hidden
this.Write(", ");
#line 44 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(command.TSArgTypes != null ? "[args]" : "args"));
#line default
#line hidden
this.Write(");\r\n }\r\n");
#line 46 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
this.Write("};\r\n");
#line 48 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
if (ns != "") {
#line default
#line hidden
this.Write("}\r\n");
#line 50 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
#line 51 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class TSTypesBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class TSTypes : TSTypesBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("\r\n/*************************************************************\r\nTHIS FILE WAS A" +
"UTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n********************************" +
"******************************/\r\n\r\nimport type {\r\n");
#line 12 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
foreach (var type in Types.Where(t => Util.HasCtor(t) && Util.GetTSNamespace(t) == "")) {
#line default
#line hidden
this.Write(" ");
#line 13 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetNativePropsName(type)));
#line default
#line hidden
this.Write(",\r\n");
#line 14 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
this.Write("} from \'./Props\';\r\n\r\n");
#line 17 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
foreach (var ns in Types.Where(t => Util.HasCtor(t) && Util.GetTSNamespace(t) != "").Select(t => Util.GetTSNamespace(t)).Distinct()) {
#line default
#line hidden
this.Write("import type { Native");
#line 18 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(" } from \'./Props\';\r\n");
#line 19 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
this.Write(@"
import React from 'react';
import { NativeXamlControl } from './NativeXamlControl';
import { findNodeHandle, UIManager } from 'react-native';
import type { Point } from './Props';
const xamlCommands = UIManager.getViewManagerConfig('XamlControl').Commands;
");
#line 29 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
foreach (var type in Types.Where(t => Util.HasCtor(t))) {
var ns = Util.GetTSNamespace(type);
if (ns != "") {
#line default
#line hidden
this.Write("export namespace ");
#line 33 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(" {\r\n");
#line 34 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
this.Write("export type ");
#line 35 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write("Props = Omit<");
#line 35 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetNativePropsName(type)));
#line default
#line hidden
this.Write(", \'type\'>;\r\n\r\nexport class ");
#line 37 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write(" extends React.Component<");
#line 37 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write("Props> {\r\n render() {\r\n return <NativeXamlControl {...this.props} type=\'");
#line 39 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(type.GetFullName()));
#line default
#line hidden
this.Write("\' />;\r\n }\r\n");
#line 41 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
foreach (var command in Util.GetCommands(type.GetFullName())) {
#line default
#line hidden
this.Write(" static ");
#line 42 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(command.Name));
#line default
#line hidden
this.Write("(ref: React.MutableRefObject<");
#line 42 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.ToJsName(type)));
#line default
#line hidden
this.Write(">, args: ");
#line 42 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(command.TSArgTypes != null ? command.TSArgTypes : "any[]"));
#line default
#line hidden
this.Write(") {\r\n const tag = findNodeHandle(ref.current);\r\n UIManager.dispatchViewMana" +
"gerCommand(tag, xamlCommands.");
#line 44 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(command.Name));
#line default
#line hidden
this.Write(", ");
#line 44 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(command.TSArgTypes != null ? "[args]" : "args"));
#line default
#line hidden
this.Write(");\r\n }\r\n");
#line 46 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
this.Write("};\r\n");
#line 48 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
if (ns != "") {
#line default
#line hidden
this.Write("}\r\n");
#line 50 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
#line 51 "F:\react-native-xaml\package\Codegen\TSTypes.tt"
}
#line default
#line hidden
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class TSTypesBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}

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

@ -1,51 +1,51 @@
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
import type {
<# foreach (var type in Types.Where(t => Util.HasCtor(t) && Util.GetTSNamespace(t) == "")) { #>
<#= Util.GetNativePropsName(type) #>,
<# } #>
} from './Props';
<# foreach (var ns in Types.Where(t => Util.HasCtor(t) && Util.GetTSNamespace(t) != "").Select(t => Util.GetTSNamespace(t)).Distinct()) { #>
import type { Native<#= ns #> } from './Props';
<# } #>
import React from 'react';
import { NativeXamlControl } from './NativeXamlControl';
import { findNodeHandle, UIManager } from 'react-native';
import type { Point } from './Props';
const xamlCommands = UIManager.getViewManagerConfig('XamlControl').Commands;
<#
foreach (var type in Types.Where(t => Util.HasCtor(t))) {
var ns = Util.GetTSNamespace(type);
if (ns != "") { #>
export namespace <#= ns #> {
<# } #>
export type <#= Util.ToJsName(type) #>Props = Omit<<#= Util.GetNativePropsName(type) #>, 'type'>;
export class <#= Util.ToJsName(type) #> extends React.Component<<#= Util.ToJsName(type) #>Props> {
render() {
return <NativeXamlControl {...this.props} type='<#= type.GetFullName() #>' />;
}
<# foreach (var command in Util.GetCommands(type.GetFullName())) { #>
static <#= command.Name #>(ref: React.MutableRefObject<<#= Util.ToJsName(type) #>>, args: <#= command.TSArgTypes != null ? command.TSArgTypes : "any[]" #>) {
const tag = findNodeHandle(ref.current);
UIManager.dispatchViewManagerCommand(tag, xamlCommands.<#= command.Name #>, <#= command.TSArgTypes != null ? "[args]" : "args" #>);
}
<# } #>
};
<# if (ns != "") { #>
}
<# } #>
<# } #>
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
import type {
<# foreach (var type in Types.Where(t => Util.HasCtor(t) && Util.GetTSNamespace(t) == "")) { #>
<#= Util.GetNativePropsName(type) #>,
<# } #>
} from './Props';
<# foreach (var ns in Types.Where(t => Util.HasCtor(t) && Util.GetTSNamespace(t) != "").Select(t => Util.GetTSNamespace(t)).Distinct()) { #>
import type { Native<#= ns #> } from './Props';
<# } #>
import React from 'react';
import { NativeXamlControl } from './NativeXamlControl';
import { findNodeHandle, UIManager } from 'react-native';
import type { Point } from './Props';
const xamlCommands = UIManager.getViewManagerConfig('XamlControl').Commands;
<#
foreach (var type in Types.Where(t => Util.HasCtor(t))) {
var ns = Util.GetTSNamespace(type);
if (ns != "") { #>
export namespace <#= ns #> {
<# } #>
export type <#= Util.ToJsName(type) #>Props = Omit<<#= Util.GetNativePropsName(type) #>, 'type'>;
export class <#= Util.ToJsName(type) #> extends React.Component<<#= Util.ToJsName(type) #>Props> {
render() {
return <NativeXamlControl {...this.props} type='<#= type.GetFullName() #>' />;
}
<# foreach (var command in Util.GetCommands(type.GetFullName())) { #>
static <#= command.Name #>(ref: React.MutableRefObject<<#= Util.ToJsName(type) #>>, args: <#= command.TSArgTypes != null ? command.TSArgTypes : "any[]" #>) {
const tag = findNodeHandle(ref.current);
UIManager.dispatchViewManagerCommand(tag, xamlCommands.<#= command.Name #>, <#= command.TSArgTypes != null ? "[args]" : "args" #>);
}
<# } #>
};
<# if (ns != "") { #>
}
<# } #>
<# } #>

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

@ -1,386 +1,386 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class TypeCreator : TypeCreatorBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("#include \"pch.h\"\r\n#include \"XamlMetadata.h\"\r\n#include \"Crc32Str.h\"\r\n#include <win" +
"string.h>\r\n\r\n");
#line 11 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
foreach (var ns in Types.Select(x => x.GetNamespace()).Distinct()) {
#line default
#line hidden
this.Write("#include \"winrt/");
#line 12 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(".h\"\r\n");
#line 13 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
}
#line default
#line hidden
this.Write(@"
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
winrt::Windows::Foundation::IInspectable XamlMetadata::Create(const std::string_view& typeName) const {
wchar_t buf[128]{};
for (auto i = 0u; i < typeName.size() && i < ARRAYSIZE(buf) - 1; i++) {
buf[i] = static_cast<wchar_t>(typeName[i]);
}
HSTRING clsid = nullptr;
if (SUCCEEDED(WindowsCreateString(buf, static_cast<UINT32>(wcslen(buf)), &clsid))) {
winrt::com_ptr<::IInspectable> insp{ nullptr };
if (SUCCEEDED(RoActivateInstance(clsid, insp.put()))) {
winrt::IUnknown unk{ nullptr };
winrt::copy_from_abi(unk, insp.get());
WindowsDeleteString(clsid);
return unk.as<winrt::IInspectable>();
} else {
// type probably has a custom activation factory, use C++/WinRT to create it
WindowsDeleteString(clsid);
clsid = nullptr;
const auto key = COMPILE_TIME_CRC32_STR(typeName.data());
switch (key) {
");
#line 39 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
foreach (var t in Types.Where(t => Util.GetComposableFactoryType(t) != null)) {
#line default
#line hidden
this.Write(" case COMPILE_TIME_CRC32_STR(\"");
#line 40 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(t.GetFullName()));
#line default
#line hidden
this.Write("\"): { return ");
#line 40 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetCppWinRTType(t)));
#line default
#line hidden
this.Write("(); }\r\n");
#line 41 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
}
#line default
#line hidden
this.Write(" }\r\n }\r\n }\r\n assert(false && \"xaml type not found\");\r\n return nullptr;\r\n" +
"}\r\n\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class TypeCreatorBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class TypeCreator : TypeCreatorBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("#include \"pch.h\"\r\n#include \"XamlMetadata.h\"\r\n#include \"Crc32Str.h\"\r\n#include <win" +
"string.h>\r\n\r\n");
#line 11 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
foreach (var ns in Types.Select(x => x.GetNamespace()).Distinct()) {
#line default
#line hidden
this.Write("#include \"winrt/");
#line 12 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(".h\"\r\n");
#line 13 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
}
#line default
#line hidden
this.Write(@"
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
winrt::Windows::Foundation::IInspectable XamlMetadata::Create(const std::string_view& typeName) const {
wchar_t buf[128]{};
for (auto i = 0u; i < typeName.size() && i < ARRAYSIZE(buf) - 1; i++) {
buf[i] = static_cast<wchar_t>(typeName[i]);
}
HSTRING clsid = nullptr;
if (SUCCEEDED(WindowsCreateString(buf, static_cast<UINT32>(wcslen(buf)), &clsid))) {
winrt::com_ptr<::IInspectable> insp{ nullptr };
if (SUCCEEDED(RoActivateInstance(clsid, insp.put()))) {
winrt::IUnknown unk{ nullptr };
winrt::copy_from_abi(unk, insp.get());
WindowsDeleteString(clsid);
return unk.as<winrt::IInspectable>();
} else {
// type probably has a custom activation factory, use C++/WinRT to create it
WindowsDeleteString(clsid);
clsid = nullptr;
const auto key = COMPILE_TIME_CRC32_STR(typeName.data());
switch (key) {
");
#line 39 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
foreach (var t in Types.Where(t => Util.GetComposableFactoryType(t) != null)) {
#line default
#line hidden
this.Write(" case COMPILE_TIME_CRC32_STR(\"");
#line 40 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(t.GetFullName()));
#line default
#line hidden
this.Write("\"): { return ");
#line 40 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetCppWinRTType(t)));
#line default
#line hidden
this.Write("(); }\r\n");
#line 41 "F:\react-native-xaml\package\Codegen\TypeCreator.tt"
}
#line default
#line hidden
this.Write(" }\r\n }\r\n }\r\n assert(false && \"xaml type not found\");\r\n return nullptr;\r\n" +
"}\r\n\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class TypeCreatorBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}

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

@ -1,49 +1,49 @@
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
#include "pch.h"
#include "XamlMetadata.h"
#include "Crc32Str.h"
#include <winstring.h>
<# foreach (var ns in Types.Select(x => x.GetNamespace()).Distinct()) { #>
#include "winrt/<#= ns #>.h"
<# } #>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
winrt::Windows::Foundation::IInspectable XamlMetadata::Create(const std::string_view& typeName) const {
wchar_t buf[128]{};
for (auto i = 0u; i < typeName.size() && i < ARRAYSIZE(buf) - 1; i++) {
buf[i] = static_cast<wchar_t>(typeName[i]);
}
HSTRING clsid = nullptr;
if (SUCCEEDED(WindowsCreateString(buf, static_cast<UINT32>(wcslen(buf)), &clsid))) {
winrt::com_ptr<::IInspectable> insp{ nullptr };
if (SUCCEEDED(RoActivateInstance(clsid, insp.put()))) {
winrt::IUnknown unk{ nullptr };
winrt::copy_from_abi(unk, insp.get());
WindowsDeleteString(clsid);
return unk.as<winrt::IInspectable>();
} else {
// type probably has a custom activation factory, use C++/WinRT to create it
WindowsDeleteString(clsid);
clsid = nullptr;
const auto key = COMPILE_TIME_CRC32_STR(typeName.data());
switch (key) {
<# foreach (var t in Types.Where(t => Util.GetComposableFactoryType(t) != null)) { #>
case COMPILE_TIME_CRC32_STR("<#= t.GetFullName() #>"): { return <#= Util.GetCppWinRTType(t) #>(); }
<# } #>
}
}
}
assert(false && "xaml type not found");
return nullptr;
}
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
#include "pch.h"
#include "XamlMetadata.h"
#include "Crc32Str.h"
#include <winstring.h>
<# foreach (var ns in Types.Select(x => x.GetNamespace()).Distinct()) { #>
#include "winrt/<#= ns #>.h"
<# } #>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
winrt::Windows::Foundation::IInspectable XamlMetadata::Create(const std::string_view& typeName) const {
wchar_t buf[128]{};
for (auto i = 0u; i < typeName.size() && i < ARRAYSIZE(buf) - 1; i++) {
buf[i] = static_cast<wchar_t>(typeName[i]);
}
HSTRING clsid = nullptr;
if (SUCCEEDED(WindowsCreateString(buf, static_cast<UINT32>(wcslen(buf)), &clsid))) {
winrt::com_ptr<::IInspectable> insp{ nullptr };
if (SUCCEEDED(RoActivateInstance(clsid, insp.put()))) {
winrt::IUnknown unk{ nullptr };
winrt::copy_from_abi(unk, insp.get());
WindowsDeleteString(clsid);
return unk.as<winrt::IInspectable>();
} else {
// type probably has a custom activation factory, use C++/WinRT to create it
WindowsDeleteString(clsid);
clsid = nullptr;
const auto key = COMPILE_TIME_CRC32_STR(typeName.data());
switch (key) {
<# foreach (var t in Types.Where(t => Util.GetComposableFactoryType(t) != null)) { #>
case COMPILE_TIME_CRC32_STR("<#= t.GetFullName() #>"): { return <#= Util.GetCppWinRTType(t) #>(); }
<# } #>
}
}
}
assert(false && "xaml type not found");
return nullptr;
}

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

@ -1,360 +1,360 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class TypeEnums : TypeEnumsBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("#pragma once\r\n/*************************************************************\r\nTHI" +
"S FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n********************" +
"******************************************/\r\n\r\n");
#line 12 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
foreach (var p in Util.fakeEnums.Where(p => p.Name.EndsWith("Priority"))) {
#line default
#line hidden
this.Write("enum class ");
#line 13 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Name));
#line default
#line hidden
this.Write(" {\r\n");
#line 14 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
foreach (var value in p.Values) {
#line default
#line hidden
this.Write(" ");
#line 15 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Key));
#line default
#line hidden
this.Write(" = ");
#line 15 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Value));
#line default
#line hidden
this.Write(",\r\n");
#line 16 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
}
#line default
#line hidden
this.Write("};\r\n\r\n");
#line 19 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
}
#line default
#line hidden
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class TypeEnumsBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class TypeEnums : TypeEnumsBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("#pragma once\r\n/*************************************************************\r\nTHI" +
"S FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n********************" +
"******************************************/\r\n\r\n");
#line 12 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
foreach (var p in Util.fakeEnums.Where(p => p.Name.EndsWith("Priority"))) {
#line default
#line hidden
this.Write("enum class ");
#line 13 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Name));
#line default
#line hidden
this.Write(" {\r\n");
#line 14 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
foreach (var value in p.Values) {
#line default
#line hidden
this.Write(" ");
#line 15 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Key));
#line default
#line hidden
this.Write(" = ");
#line 15 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(value.Value));
#line default
#line hidden
this.Write(",\r\n");
#line 16 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
}
#line default
#line hidden
this.Write("};\r\n\r\n");
#line 19 "F:\react-native-xaml\package\Codegen\TypeEnums.tt"
}
#line default
#line hidden
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class TypeEnumsBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}

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

@ -1,19 +1,19 @@
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".h" #>
#pragma once
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var p in Util.fakeEnums.Where(p => p.Name.EndsWith("Priority"))) { #>
enum class <#= p.Name #> {
<# foreach (var value in p.Values) { #>
<#= value.Key #> = <#= value.Value #>,
<# } #>
};
<# } #>
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".h" #>
#pragma once
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var p in Util.fakeEnums.Where(p => p.Name.EndsWith("Priority"))) { #>
enum class <#= p.Name #> {
<# foreach (var value in p.Values) { #>
<#= value.Key #> = <#= value.Value #>,
<# } #>
};
<# } #>

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

@ -1,477 +1,477 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class TypeEvents : TypeEventsBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write(@"#pragma once
#include ""pch.h""
#include ""XamlMetadata.h""
#include ""Serialize.h""
#include ""Crc32Str.h""
#include <JSValueWriter.h>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
");
#line 17 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
foreach (var ns in Events.Select(p => p.DeclaringType.GetNamespace()).Distinct()) {
#line default
#line hidden
this.Write("#include <winrt/");
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(".h>\r\n");
#line 19 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
}
#line default
#line hidden
this.Write("#include <winrt/");
#line 20 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(XamlNames.XamlNamespace));
#line default
#line hidden
this.Write(".Input.h>\r\n\r\n/////// Events\r\ntemplate<typename TArgs>\r\nvoid SerializeEventArgs(wi" +
"nrt::Microsoft::ReactNative::IJSValueWriter const& writer, const winrt::Windows:" +
":Foundation::IInspectable& sender, const TArgs& args);\r\n\r\n\r\ntemplate<typename T>" +
"\r\n__declspec(noinline) T DoTheTypeChecking(const winrt::Windows::Foundation::IIn" +
"spectable& ii, bool isWrapped) {\r\n auto o = isWrapped ? Unwrap<T>(ii) : ii.try_" +
"as<T>();\r\n return o;\r\n}\r\n\r\ntemplate<typename T>\r\n__declspec(noinline) void Disp" +
"atchTheEvent(const EventAttachInfo& eai, const winrt::Windows::Foundation::IInsp" +
"ectable& sender, const T& args) {\r\n auto senderAsFE = sender.try_as<FrameworkEl" +
"ement>();\r\n auto wEN = winrt::to_hstring(eai.jsEventName);\r\n if (eai.xamlMetad" +
"ata.m_callFunctionReturnFlushedQueue.has_value()) {\r\n const auto tag = winrt:" +
":unbox_value<int64_t>(eai.obj.as<FrameworkElement>().Tag());\r\n ExecuteJsi(eai" +
".context, [metadata = eai.xamlMetadata.shared_from_this(), tag, senderAsFE, args" +
", eventName = eai.jsEventName](facebook::jsi::Runtime& rt) {\r\n auto objSend" +
"er = std::make_shared<XamlObject>(senderAsFE, metadata);\r\n auto objArgs = s" +
"td::make_shared<XamlObject>(args, metadata);\r\n auto obj = std::make_shared<" +
"facebook::jsi::Object>(rt);\r\n obj->setProperty(rt, \"sender\", rt.global().cr" +
"eateFromHostObject(rt, objSender));\r\n obj->setProperty(rt, \"args\", rt.globa" +
"l().createFromHostObject(rt, objArgs));\r\n\r\n metadata->JsiDispatchEvent(rt, " +
"tag, std::string(eventName), obj);\r\n });\r\n }\r\n else {\r\n XamlUIService:" +
":FromContext(eai.context).DispatchEvent(eai.obj.try_as<xaml::FrameworkElement>()" +
", wEN.c_str(),\r\n [senderAsFE, args](const winrt::Microsoft::ReactNative::IJ" +
"SValueWriter& evtDataWriter) {\r\n SerializeEventArgs(evtDataWriter, sender" +
"AsFE, args);\r\n });\r\n }\r\n};\r\n\r\n/*static*/ const EventInfo EventInfo::xamlEv" +
"entMap[] = {\r\n");
#line 58 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
foreach (var evt in Events) {
#line default
#line hidden
this.Write(" {\"");
#line 59 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.GetName()));
#line default
#line hidden
this.Write("\", [](const EventAttachInfo& eai, bool isWrapped, winrt::event_token token) noexc" +
"ept {\r\n if (const auto& c = DoTheTypeChecking<");
#line 60 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetCppWinRTType(evt.DeclaringType)));
#line default
#line hidden
this.Write(">(eai.obj, isWrapped)) {\r\n if (!token) {\r\n return c.");
#line 62 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.GetName()));
#line default
#line hidden
this.Write("([eai] (");
#line 62 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetCppWinRTEventSignature(evt)));
#line default
#line hidden
this.Write(") noexcept {\r\n DispatchTheEvent(eai, sender, args);\r\n });\r\n " +
" } else {\r\n c.");
#line 66 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.GetName()));
#line default
#line hidden
this.Write("(token);\r\n return winrt::event_token{ -1 };\r\n }\r\n }\r\n return wi" +
"nrt::event_token{0};\r\n } },\r\n");
#line 72 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
}
#line default
#line hidden
#line 73 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
foreach (var evt in SyntheticEvents) {
#line default
#line hidden
this.Write(" {\"");
#line 74 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.Name));
#line default
#line hidden
this.Write("\", nullptr /* synthetic event */},\r\n");
#line 75 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
}
#line default
#line hidden
this.Write("};\r\n\r\nstatic_assert(ARRAYSIZE(EventInfo::xamlEventMap) == ");
#line 78 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Events.Count() + SyntheticEvents.Count()));
#line default
#line hidden
this.Write(@");
void JsEvent(winrt::Microsoft::ReactNative::IJSValueWriter const& constantWriter, std::wstring topName, std::wstring onName) {
constantWriter.WritePropertyName(topName);
constantWriter.WriteObjectBegin();
WriteProperty(constantWriter, L""registrationName"", onName);
constantWriter.WriteObjectEnd();
}
#define JS_EVENT(evtName) JsEvent(constantWriter, L""top"" L#evtName, L""on"" L#evtName)
ConstantProviderDelegate GetEvents =
[](winrt::Microsoft::ReactNative::IJSValueWriter const& constantWriter) {
for (auto const& e : EventInfo::xamlEventMap) {
auto wideName = std::wstring(winrt::to_hstring(e.name));
JsEvent(constantWriter, L""top"" + wideName, L""on"" + wideName);
}
};
void XamlMetadata::PopulateNativeEvents(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const {
for (const auto& evtInfo : EventInfo::xamlEventMap) {
auto jsEvtName = L""on"" + winrt::to_hstring(evtInfo.name);
nativeProps.Insert(jsEvtName, ViewManagerPropertyType::Boolean);
}
}
");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class TypeEventsBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class TypeEvents : TypeEventsBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write(@"#pragma once
#include ""pch.h""
#include ""XamlMetadata.h""
#include ""Serialize.h""
#include ""Crc32Str.h""
#include <JSValueWriter.h>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
");
#line 17 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
foreach (var ns in Events.Select(p => p.DeclaringType.GetNamespace()).Distinct()) {
#line default
#line hidden
this.Write("#include <winrt/");
#line 18 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ns));
#line default
#line hidden
this.Write(".h>\r\n");
#line 19 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
}
#line default
#line hidden
this.Write("#include <winrt/");
#line 20 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(XamlNames.XamlNamespace));
#line default
#line hidden
this.Write(".Input.h>\r\n\r\n/////// Events\r\ntemplate<typename TArgs>\r\nvoid SerializeEventArgs(wi" +
"nrt::Microsoft::ReactNative::IJSValueWriter const& writer, const winrt::Windows:" +
":Foundation::IInspectable& sender, const TArgs& args);\r\n\r\n\r\ntemplate<typename T>" +
"\r\n__declspec(noinline) T DoTheTypeChecking(const winrt::Windows::Foundation::IIn" +
"spectable& ii, bool isWrapped) {\r\n auto o = isWrapped ? Unwrap<T>(ii) : ii.try_" +
"as<T>();\r\n return o;\r\n}\r\n\r\ntemplate<typename T>\r\n__declspec(noinline) void Disp" +
"atchTheEvent(const EventAttachInfo& eai, const winrt::Windows::Foundation::IInsp" +
"ectable& sender, const T& args) {\r\n auto senderAsFE = sender.try_as<FrameworkEl" +
"ement>();\r\n auto wEN = winrt::to_hstring(eai.jsEventName);\r\n if (eai.xamlMetad" +
"ata.m_callFunctionReturnFlushedQueue.has_value()) {\r\n const auto tag = winrt:" +
":unbox_value<int64_t>(eai.obj.as<FrameworkElement>().Tag());\r\n ExecuteJsi(eai" +
".context, [metadata = eai.xamlMetadata.shared_from_this(), tag, senderAsFE, args" +
", eventName = eai.jsEventName](facebook::jsi::Runtime& rt) {\r\n auto objSend" +
"er = std::make_shared<XamlObject>(senderAsFE, metadata);\r\n auto objArgs = s" +
"td::make_shared<XamlObject>(args, metadata);\r\n auto obj = std::make_shared<" +
"facebook::jsi::Object>(rt);\r\n obj->setProperty(rt, \"sender\", rt.global().cr" +
"eateFromHostObject(rt, objSender));\r\n obj->setProperty(rt, \"args\", rt.globa" +
"l().createFromHostObject(rt, objArgs));\r\n\r\n metadata->JsiDispatchEvent(rt, " +
"tag, std::string(eventName), obj);\r\n });\r\n }\r\n else {\r\n XamlUIService:" +
":FromContext(eai.context).DispatchEvent(eai.obj.try_as<xaml::FrameworkElement>()" +
", wEN.c_str(),\r\n [senderAsFE, args](const winrt::Microsoft::ReactNative::IJ" +
"SValueWriter& evtDataWriter) {\r\n SerializeEventArgs(evtDataWriter, sender" +
"AsFE, args);\r\n });\r\n }\r\n};\r\n\r\n/*static*/ const EventInfo EventInfo::xamlEv" +
"entMap[] = {\r\n");
#line 58 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
foreach (var evt in Events) {
#line default
#line hidden
this.Write(" {\"");
#line 59 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.GetName()));
#line default
#line hidden
this.Write("\", [](const EventAttachInfo& eai, bool isWrapped, winrt::event_token token) noexc" +
"ept {\r\n if (const auto& c = DoTheTypeChecking<");
#line 60 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetCppWinRTType(evt.DeclaringType)));
#line default
#line hidden
this.Write(">(eai.obj, isWrapped)) {\r\n if (!token) {\r\n return c.");
#line 62 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.GetName()));
#line default
#line hidden
this.Write("([eai] (");
#line 62 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Util.GetCppWinRTEventSignature(evt)));
#line default
#line hidden
this.Write(") noexcept {\r\n DispatchTheEvent(eai, sender, args);\r\n });\r\n " +
" } else {\r\n c.");
#line 66 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.GetName()));
#line default
#line hidden
this.Write("(token);\r\n return winrt::event_token{ -1 };\r\n }\r\n }\r\n return wi" +
"nrt::event_token{0};\r\n } },\r\n");
#line 72 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
}
#line default
#line hidden
#line 73 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
foreach (var evt in SyntheticEvents) {
#line default
#line hidden
this.Write(" {\"");
#line 74 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(evt.Name));
#line default
#line hidden
this.Write("\", nullptr /* synthetic event */},\r\n");
#line 75 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
}
#line default
#line hidden
this.Write("};\r\n\r\nstatic_assert(ARRAYSIZE(EventInfo::xamlEventMap) == ");
#line 78 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\TypeEvents.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Events.Count() + SyntheticEvents.Count()));
#line default
#line hidden
this.Write(@");
void JsEvent(winrt::Microsoft::ReactNative::IJSValueWriter const& constantWriter, std::wstring topName, std::wstring onName) {
constantWriter.WritePropertyName(topName);
constantWriter.WriteObjectBegin();
WriteProperty(constantWriter, L""registrationName"", onName);
constantWriter.WriteObjectEnd();
}
#define JS_EVENT(evtName) JsEvent(constantWriter, L""top"" L#evtName, L""on"" L#evtName)
ConstantProviderDelegate GetEvents =
[](winrt::Microsoft::ReactNative::IJSValueWriter const& constantWriter) {
for (auto const& e : EventInfo::xamlEventMap) {
auto wideName = std::wstring(winrt::to_hstring(e.name));
JsEvent(constantWriter, L""top"" + wideName, L""on"" + wideName);
}
};
void XamlMetadata::PopulateNativeEvents(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const {
for (const auto& evtInfo : EventInfo::xamlEventMap) {
auto jsEvtName = L""on"" + winrt::to_hstring(evtInfo.name);
nativeProps.Insert(jsEvtName, ViewManagerPropertyType::Boolean);
}
}
");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class TypeEventsBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}

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

@ -1,103 +1,103 @@
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
#pragma once
#include "pch.h"
#include "XamlMetadata.h"
#include "Serialize.h"
#include "Crc32Str.h"
#include <JSValueWriter.h>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var ns in Events.Select(p => p.DeclaringType.GetNamespace()).Distinct()) { #>
#include <winrt/<#= ns #>.h>
<# } #>
#include <winrt/<#= XamlNames.XamlNamespace #>.Input.h>
/////// Events
template<typename TArgs>
void SerializeEventArgs(winrt::Microsoft::ReactNative::IJSValueWriter const& writer, const winrt::Windows::Foundation::IInspectable& sender, const TArgs& args);
template<typename T>
__declspec(noinline) T DoTheTypeChecking(const winrt::Windows::Foundation::IInspectable& ii, bool isWrapped) {
auto o = isWrapped ? Unwrap<T>(ii) : ii.try_as<T>();
return o;
}
template<typename T>
__declspec(noinline) void DispatchTheEvent(const EventAttachInfo& eai, const winrt::Windows::Foundation::IInspectable& sender, const T& args) {
auto senderAsFE = sender.try_as<FrameworkElement>();
auto wEN = winrt::to_hstring(eai.jsEventName);
if (eai.xamlMetadata.m_callFunctionReturnFlushedQueue.has_value()) {
const auto tag = winrt::unbox_value<int64_t>(eai.obj.as<FrameworkElement>().Tag());
ExecuteJsi(eai.context, [metadata = eai.xamlMetadata.shared_from_this(), tag, senderAsFE, args, eventName = eai.jsEventName](facebook::jsi::Runtime& rt) {
auto objSender = std::make_shared<XamlObject>(senderAsFE, metadata);
auto objArgs = std::make_shared<XamlObject>(args, metadata);
auto obj = std::make_shared<facebook::jsi::Object>(rt);
obj->setProperty(rt, "sender", rt.global().createFromHostObject(rt, objSender));
obj->setProperty(rt, "args", rt.global().createFromHostObject(rt, objArgs));
metadata->JsiDispatchEvent(rt, tag, std::string(eventName), obj);
});
}
else {
XamlUIService::FromContext(eai.context).DispatchEvent(eai.obj.try_as<xaml::FrameworkElement>(), wEN.c_str(),
[senderAsFE, args](const winrt::Microsoft::ReactNative::IJSValueWriter& evtDataWriter) {
SerializeEventArgs(evtDataWriter, senderAsFE, args);
});
}
};
/*static*/ const EventInfo EventInfo::xamlEventMap[] = {
<# foreach (var evt in Events) { #>
{"<#= evt.GetName() #>", [](const EventAttachInfo& eai, bool isWrapped, winrt::event_token token) noexcept {
if (const auto& c = DoTheTypeChecking<<#= Util.GetCppWinRTType(evt.DeclaringType) #>>(eai.obj, isWrapped)) {
if (!token) {
return c.<#= evt.GetName() #>([eai] (<#= Util.GetCppWinRTEventSignature(evt) #>) noexcept {
DispatchTheEvent(eai, sender, args);
});
} else {
c.<#= evt.GetName() #>(token);
return winrt::event_token{ -1 };
}
}
return winrt::event_token{0};
} },
<# } #>
<# foreach (var evt in SyntheticEvents) { #>
{"<#= evt.Name #>", nullptr /* synthetic event */},
<# } #>
};
static_assert(ARRAYSIZE(EventInfo::xamlEventMap) == <#= Events.Count() + SyntheticEvents.Count() #>);
void JsEvent(winrt::Microsoft::ReactNative::IJSValueWriter const& constantWriter, std::wstring topName, std::wstring onName) {
constantWriter.WritePropertyName(topName);
constantWriter.WriteObjectBegin();
WriteProperty(constantWriter, L"registrationName", onName);
constantWriter.WriteObjectEnd();
}
#define JS_EVENT(evtName) JsEvent(constantWriter, L"top" L#evtName, L"on" L#evtName)
ConstantProviderDelegate GetEvents =
[](winrt::Microsoft::ReactNative::IJSValueWriter const& constantWriter) {
for (auto const& e : EventInfo::xamlEventMap) {
auto wideName = std::wstring(winrt::to_hstring(e.name));
JsEvent(constantWriter, L"top" + wideName, L"on" + wideName);
}
};
void XamlMetadata::PopulateNativeEvents(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const {
for (const auto& evtInfo : EventInfo::xamlEventMap) {
auto jsEvtName = L"on" + winrt::to_hstring(evtInfo.name);
nativeProps.Insert(jsEvtName, ViewManagerPropertyType::Boolean);
}
}
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
#pragma once
#include "pch.h"
#include "XamlMetadata.h"
#include "Serialize.h"
#include "Crc32Str.h"
#include <JSValueWriter.h>
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var ns in Events.Select(p => p.DeclaringType.GetNamespace()).Distinct()) { #>
#include <winrt/<#= ns #>.h>
<# } #>
#include <winrt/<#= XamlNames.XamlNamespace #>.Input.h>
/////// Events
template<typename TArgs>
void SerializeEventArgs(winrt::Microsoft::ReactNative::IJSValueWriter const& writer, const winrt::Windows::Foundation::IInspectable& sender, const TArgs& args);
template<typename T>
__declspec(noinline) T DoTheTypeChecking(const winrt::Windows::Foundation::IInspectable& ii, bool isWrapped) {
auto o = isWrapped ? Unwrap<T>(ii) : ii.try_as<T>();
return o;
}
template<typename T>
__declspec(noinline) void DispatchTheEvent(const EventAttachInfo& eai, const winrt::Windows::Foundation::IInspectable& sender, const T& args) {
auto senderAsFE = sender.try_as<FrameworkElement>();
auto wEN = winrt::to_hstring(eai.jsEventName);
if (eai.xamlMetadata.m_callFunctionReturnFlushedQueue.has_value()) {
const auto tag = winrt::unbox_value<int64_t>(eai.obj.as<FrameworkElement>().Tag());
ExecuteJsi(eai.context, [metadata = eai.xamlMetadata.shared_from_this(), tag, senderAsFE, args, eventName = eai.jsEventName](facebook::jsi::Runtime& rt) {
auto objSender = std::make_shared<XamlObject>(senderAsFE, metadata);
auto objArgs = std::make_shared<XamlObject>(args, metadata);
auto obj = std::make_shared<facebook::jsi::Object>(rt);
obj->setProperty(rt, "sender", rt.global().createFromHostObject(rt, objSender));
obj->setProperty(rt, "args", rt.global().createFromHostObject(rt, objArgs));
metadata->JsiDispatchEvent(rt, tag, std::string(eventName), obj);
});
}
else {
XamlUIService::FromContext(eai.context).DispatchEvent(eai.obj.try_as<xaml::FrameworkElement>(), wEN.c_str(),
[senderAsFE, args](const winrt::Microsoft::ReactNative::IJSValueWriter& evtDataWriter) {
SerializeEventArgs(evtDataWriter, senderAsFE, args);
});
}
};
/*static*/ const EventInfo EventInfo::xamlEventMap[] = {
<# foreach (var evt in Events) { #>
{"<#= evt.GetName() #>", [](const EventAttachInfo& eai, bool isWrapped, winrt::event_token token) noexcept {
if (const auto& c = DoTheTypeChecking<<#= Util.GetCppWinRTType(evt.DeclaringType) #>>(eai.obj, isWrapped)) {
if (!token) {
return c.<#= evt.GetName() #>([eai] (<#= Util.GetCppWinRTEventSignature(evt) #>) noexcept {
DispatchTheEvent(eai, sender, args);
});
} else {
c.<#= evt.GetName() #>(token);
return winrt::event_token{ -1 };
}
}
return winrt::event_token{0};
} },
<# } #>
<# foreach (var evt in SyntheticEvents) { #>
{"<#= evt.Name #>", nullptr /* synthetic event */},
<# } #>
};
static_assert(ARRAYSIZE(EventInfo::xamlEventMap) == <#= Events.Count() + SyntheticEvents.Count() #>);
void JsEvent(winrt::Microsoft::ReactNative::IJSValueWriter const& constantWriter, std::wstring topName, std::wstring onName) {
constantWriter.WritePropertyName(topName);
constantWriter.WriteObjectBegin();
WriteProperty(constantWriter, L"registrationName", onName);
constantWriter.WriteObjectEnd();
}
#define JS_EVENT(evtName) JsEvent(constantWriter, L"top" L#evtName, L"on" L#evtName)
ConstantProviderDelegate GetEvents =
[](winrt::Microsoft::ReactNative::IJSValueWriter const& constantWriter) {
for (auto const& e : EventInfo::xamlEventMap) {
auto wideName = std::wstring(winrt::to_hstring(e.name));
JsEvent(constantWriter, L"top" + wideName, L"on" + wideName);
}
};
void XamlMetadata::PopulateNativeEvents(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const {
for (const auto& evtInfo : EventInfo::xamlEventMap) {
auto jsEvtName = L"on" + winrt::to_hstring(evtInfo.name);
nativeProps.Insert(jsEvtName, ViewManagerPropertyType::Boolean);
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,94 +1,94 @@
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
#pragma once
#include "pch.h"
#include "XamlMetadata.h"
#include "Crc32Str.h"
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var ns in Properties.Select(p => p.DeclaringType.GetNamespace()).Distinct()) { #>
#include <winrt/<#= ns #>.h>
<# } #>
template<typename T>
winrt::Windows::Foundation::IInspectable AsType(const winrt::Windows::Foundation::IInspectable& o) {
return o.try_as<T>();
}
template<typename T>
winrt::Windows::Foundation::IInspectable AsUnwrappedType(const winrt::Windows::Foundation::IInspectable& o) {
return Unwrap<T>(o);
}
/*static*/ const PropInfo xamlPropertyMap[] = {
<# foreach (var p in Properties) { #>
{ MAKE_KEY("<#= Util.ToJsName(p) #>"), <#= (Util.DerivesFrom(p.DeclaringType, $"{XamlNames.XamlNamespace}.FrameworkElement") || p.DeclaringType.GetName() == "UIElement") ? "AsType" : "AsUnwrappedType" #><<#= Util.GetCppWinRTType(p.DeclaringType) #>>, []() { return <#= Util.GetCppWinRTType(p.Property != null ? p.Property.DeclaringType : p.DeclaringType) #>::<#= p.SimpleName #>Property(); }, SetPropValue<<#= p.PropertyType != null ? Util.GetCppWinRTType(p.PropertyType) : Util.GetCppWinRTType(p.Property.GetPropertyType()) #>>, ViewManagerPropertyType::<#= Util.GetVMPropertyType(p) #> },
<# } #>
};
<# foreach (var p in FakeProps) { #>
void Set<#= p.GetName() #>_<#= p.DeclaringType.GetName() #>(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& reactContext);
<# } #>
<# foreach (var p in SyntheticProps) { #>
void Set<#= p.Name #>_<#= p.DeclaringType.GetName() #>(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& reactContext);
<# } #>
/*static*/ const PropInfo fakeProps[] = {
<# foreach (var p in FakeProps) { #>
{ MAKE_KEY("<#= Util.ToJsName(p) #>"), AsUnwrappedType<<#= Util.GetCppWinRTType(p.DeclaringType) #>>, nullptr, Set<#= p.GetName() #>_<#= p.DeclaringType.GetName() #>, ViewManagerPropertyType::<#= Util.GetVMPropertyType(p) #> },
<# } #>
<# foreach (var p in SyntheticProps) { #>
{ MAKE_KEY("<#= Util.ToJsName(p.Name) #>"), AsType<<#= Util.GetCppWinRTType(p.DeclaringType) #>>, nullptr, Set<#= p.Name #>_<#= p.DeclaringType.GetName() #>, ViewManagerPropertyType::<#= Util.GetVMPropertyType(p) #> },
<# } #>
};
#ifdef USE_CRC32
void XamlMetadata::PopulateNativeProps(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const {
<# foreach (var p in Properties.Distinct(new NameEqualityComparer())) { #>
nativeProps.Insert(winrt::to_hstring("<#= Util.ToJsName(p) #>"), ViewManagerPropertyType::<#= Util.GetVMPropertyType(p) #>);
<# } #>
}
#else
void XamlMetadata::PopulateNativeProps(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const {
for (auto const& entry : xamlPropertyMap) {
nativeProps.Insert(winrt::to_hstring(entry.propName), entry.jsType);
}
for (auto const& entry : fakeProps) {
nativeProps.Insert(winrt::to_hstring(entry.propName), entry.jsType);
}
}
#endif
struct XamlCommand {
const char* name;
void (*pfn)(FrameworkElement fe, const winrt::Microsoft::ReactNative::JSValueArray& args, const XamlMetadata& xaml) noexcept;
};
<# foreach (var kv in Util.commands) { #>
<# foreach (var command in kv.Value) { #>
void <#= command.Name #>Command(FrameworkElement fe, const winrt::Microsoft::ReactNative::JSValueArray& /* args */, const XamlMetadata& xaml) noexcept;
<# } } #>
const XamlCommand xamlCommands[] = {
<# foreach (var kv in Util.commands) { #>
<# foreach (var command in kv.Value) { #>
{ "<#= command.Name #>", <#= command.Name #>Command},
<# } #>
<# } #>
};
void XamlMetadata::PopulateCommands(const winrt::Windows::Foundation::Collections::IVector<winrt::hstring>& commands) const {
for (auto const& entry : xamlCommands) {
commands.Append(winrt::to_hstring(entry.name));
}
}
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
#pragma once
#include "pch.h"
#include "XamlMetadata.h"
#include "Crc32Str.h"
/*************************************************************
THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY
**************************************************************/
<# foreach (var ns in Properties.Select(p => p.DeclaringType.GetNamespace()).Distinct()) { #>
#include <winrt/<#= ns #>.h>
<# } #>
template<typename T>
winrt::Windows::Foundation::IInspectable AsType(const winrt::Windows::Foundation::IInspectable& o) {
return o.try_as<T>();
}
template<typename T>
winrt::Windows::Foundation::IInspectable AsUnwrappedType(const winrt::Windows::Foundation::IInspectable& o) {
return Unwrap<T>(o);
}
/*static*/ const PropInfo xamlPropertyMap[] = {
<# foreach (var p in Properties) { #>
{ MAKE_KEY("<#= Util.ToJsName(p) #>"), <#= (Util.DerivesFrom(p.DeclaringType, $"{XamlNames.XamlNamespace}.FrameworkElement") || p.DeclaringType.GetName() == "UIElement") ? "AsType" : "AsUnwrappedType" #><<#= Util.GetCppWinRTType(p.DeclaringType) #>>, []() { return <#= Util.GetCppWinRTType(p.Property != null ? p.Property.DeclaringType : p.DeclaringType) #>::<#= p.SimpleName #>Property(); }, SetPropValue<<#= p.PropertyType != null ? Util.GetCppWinRTType(p.PropertyType) : Util.GetCppWinRTType(p.Property.GetPropertyType()) #>>, ViewManagerPropertyType::<#= Util.GetVMPropertyType(p) #> },
<# } #>
};
<# foreach (var p in FakeProps) { #>
void Set<#= p.GetName() #>_<#= p.DeclaringType.GetName() #>(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& reactContext);
<# } #>
<# foreach (var p in SyntheticProps) { #>
void Set<#= p.Name #>_<#= p.DeclaringType.GetName() #>(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& reactContext);
<# } #>
/*static*/ const PropInfo fakeProps[] = {
<# foreach (var p in FakeProps) { #>
{ MAKE_KEY("<#= Util.ToJsName(p) #>"), AsUnwrappedType<<#= Util.GetCppWinRTType(p.DeclaringType) #>>, nullptr, Set<#= p.GetName() #>_<#= p.DeclaringType.GetName() #>, ViewManagerPropertyType::<#= Util.GetVMPropertyType(p) #> },
<# } #>
<# foreach (var p in SyntheticProps) { #>
{ MAKE_KEY("<#= Util.ToJsName(p.Name) #>"), AsType<<#= Util.GetCppWinRTType(p.DeclaringType) #>>, nullptr, Set<#= p.Name #>_<#= p.DeclaringType.GetName() #>, ViewManagerPropertyType::<#= Util.GetVMPropertyType(p) #> },
<# } #>
};
#ifdef USE_CRC32
void XamlMetadata::PopulateNativeProps(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const {
<# foreach (var p in Properties.Distinct(new NameEqualityComparer())) { #>
nativeProps.Insert(winrt::to_hstring("<#= Util.ToJsName(p) #>"), ViewManagerPropertyType::<#= Util.GetVMPropertyType(p) #>);
<# } #>
}
#else
void XamlMetadata::PopulateNativeProps(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const {
for (auto const& entry : xamlPropertyMap) {
nativeProps.Insert(winrt::to_hstring(entry.propName), entry.jsType);
}
for (auto const& entry : fakeProps) {
nativeProps.Insert(winrt::to_hstring(entry.propName), entry.jsType);
}
}
#endif
struct XamlCommand {
const char* name;
void (*pfn)(FrameworkElement fe, const winrt::Microsoft::ReactNative::JSValueArray& args, const XamlMetadata& xaml) noexcept;
};
<# foreach (var kv in Util.commands) { #>
<# foreach (var command in kv.Value) { #>
void <#= command.Name #>Command(FrameworkElement fe, const winrt::Microsoft::ReactNative::JSValueArray& /* args */, const XamlMetadata& xaml) noexcept;
<# } } #>
const XamlCommand xamlCommands[] = {
<# foreach (var kv in Util.commands) { #>
<# foreach (var command in kv.Value) { #>
{ "<#= command.Name #>", <#= command.Name #>Command},
<# } #>
<# } #>
};
void XamlMetadata::PopulateCommands(const winrt::Windows::Foundation::Collections::IVector<winrt::hstring>& commands) const {
for (auto const& entry : xamlCommands) {
commands.Append(winrt::to_hstring(entry.name));
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,341 +1,341 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class VersionHeader : VersionHeaderBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("#pragma once\r\n\r\n/*************************************************************\r\nT" +
"HIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n******************" +
"********************************************/\r\n\r\n#define VERSION_MAJOR " +
" ");
#line 13 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Major));
#line default
#line hidden
this.Write("\r\n#define VERSION_MINOR ");
#line 14 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Minor));
#line default
#line hidden
this.Write("\r\n#define VERSION_REVISION ");
#line 15 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Revision == -1 ? 0 : Version.Revision));
#line default
#line hidden
this.Write("\r\n#define VERSION_BUILD ");
#line 16 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Build));
#line default
#line hidden
this.Write("\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class VersionHeaderBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Codegen
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class VersionHeader : VersionHeaderBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("#pragma once\r\n\r\n/*************************************************************\r\nT" +
"HIS FILE WAS AUTOMATICALLY GENERATED, DO NOT MODIFY MANUALLY\r\n******************" +
"********************************************/\r\n\r\n#define VERSION_MAJOR " +
" ");
#line 13 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Major));
#line default
#line hidden
this.Write("\r\n#define VERSION_MINOR ");
#line 14 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Minor));
#line default
#line hidden
this.Write("\r\n#define VERSION_REVISION ");
#line 15 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Revision == -1 ? 0 : Version.Revision));
#line default
#line hidden
this.Write("\r\n#define VERSION_BUILD ");
#line 16 "C:\Users\asklar\source\repos\react-native-xaml\package\Codegen\VersionHeader.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Version.Build));
#line default
#line hidden
this.Write("\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class VersionHeaderBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}

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

@ -1,93 +1,93 @@
#pragma once
//
//static constexpr unsigned int crc_table[256] = {
// 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
// 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
// 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
// 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
// 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
// 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
// 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
// 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
// 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
// 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
// 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
// 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
// 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
// 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
// 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
// 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
// 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
// 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
// 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
// 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
// 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
// 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
// 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
// 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
// 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
// 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
// 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
// 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
// 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
// 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
// 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
// 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
// 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
// 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
// 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
// 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
// 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
// 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
// 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
// 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
// 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
// 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
// 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
//};
//
//
//template<int size, int idx = 0, class dummy = void>
//struct MM {
// static constexpr unsigned int crc32(const char* str, unsigned int prev_crc = 0xFFFFFFFF)
// {
// return MM<size, idx + 1>::crc32(str, (prev_crc >> 8) ^ crc_table[(prev_crc ^ str[idx]) & 0xFF]);
// }
//};
//
//// This is the stop-recursion function
//template<int size, class dummy>
//struct MM<size, size, dummy> {
// static constexpr unsigned int crc32(const char* /*str*/, unsigned int prev_crc = 0xFFFFFFFF)
// {
// return prev_crc ^ 0xFFFFFFFF;
// }
//};
//
//// This don't take into account the nul char
//#define COMPILE_TIME_CRC32_STR(x) (MM<sizeof(x)-1>::crc32(x))
uint32_t constexpr const_hash(char const* input) {
return *input ?
static_cast<uint32_t>(*input) + 33 * const_hash(input + 1) :
5381;
}
#define COMPILE_TIME_CRC32_STR(x) const_hash(x)
#ifdef USE_CRC32
#define MAKE_KEY(str) COMPILE_TIME_CRC32_STR(str)
using stringKey = uint32_t;
inline bool Equals(const stringKey& a, const stringKey& b) {
return a == b;
}
#else
#define MAKE_KEY(str) str
using stringKey = const char* const;
inline bool Equals(const stringKey& a, const stringKey& b) {
return strcmp(a, b) == 0;
}
#pragma once
//
//static constexpr unsigned int crc_table[256] = {
// 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
// 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
// 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
// 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
// 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
// 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
// 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
// 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
// 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
// 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
// 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
// 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
// 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
// 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
// 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
// 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
// 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
// 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
// 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
// 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
// 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
// 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
// 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
// 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
// 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
// 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
// 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
// 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
// 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
// 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
// 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
// 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
// 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
// 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
// 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
// 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
// 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
// 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
// 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
// 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
// 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
// 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
// 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
//};
//
//
//template<int size, int idx = 0, class dummy = void>
//struct MM {
// static constexpr unsigned int crc32(const char* str, unsigned int prev_crc = 0xFFFFFFFF)
// {
// return MM<size, idx + 1>::crc32(str, (prev_crc >> 8) ^ crc_table[(prev_crc ^ str[idx]) & 0xFF]);
// }
//};
//
//// This is the stop-recursion function
//template<int size, class dummy>
//struct MM<size, size, dummy> {
// static constexpr unsigned int crc32(const char* /*str*/, unsigned int prev_crc = 0xFFFFFFFF)
// {
// return prev_crc ^ 0xFFFFFFFF;
// }
//};
//
//// This don't take into account the nul char
//#define COMPILE_TIME_CRC32_STR(x) (MM<sizeof(x)-1>::crc32(x))
uint32_t constexpr const_hash(char const* input) {
return *input ?
static_cast<uint32_t>(*input) + 33 * const_hash(input + 1) :
5381;
}
#define COMPILE_TIME_CRC32_STR(x) const_hash(x)
#ifdef USE_CRC32
#define MAKE_KEY(str) COMPILE_TIME_CRC32_STR(str)
using stringKey = uint32_t;
inline bool Equals(const stringKey& a, const stringKey& b) {
return a == b;
}
#else
#define MAKE_KEY(str) str
using stringKey = const char* const;
inline bool Equals(const stringKey& a, const stringKey& b) {
return strcmp(a, b) == 0;
}
#endif

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

@ -1,71 +1,71 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once
#ifndef MICROSOFT_REACTNATIVE_JSVALUEXAML
#define MICROSOFT_REACTNATIVE_JSVALUEXAML
#include "CppWinRTIncludes.h"
#include "JSValue.h"
namespace winrt::Microsoft::ReactNative {
#ifndef CXXUNITTESTS
inline void ReadValue(JSValue const &jsValue, xaml::Media::Brush &value) noexcept {
value = XamlHelper::BrushFrom([&jsValue](IJSValueWriter const &writer) noexcept { jsValue.WriteTo(writer); });
}
inline void ReadValue(JSValue const &jsValue, Windows::UI::Color &value) noexcept {
value = XamlHelper::ColorFrom([&jsValue](IJSValueWriter const &writer) noexcept { jsValue.WriteTo(writer); });
}
#endif
inline void ReadValue(JSValue const &jsValue, xaml::Thickness &value) noexcept {
if (auto array = jsValue.TryGetArray()) {
if (array->size() == 4) {
value = xaml::ThicknessHelper::FromLengths(
(*array)[0].AsDouble(), (*array)[1].AsDouble(), (*array)[2].AsDouble(), (*array)[3].AsDouble());
return;
}
} else if (auto number = jsValue.TryGetDouble()) {
value = xaml::ThicknessHelper::FromUniformLength(*number);
} else if (auto numberInt = jsValue.TryGetInt64()) {
const auto valueDbl = static_cast<double>(*numberInt);
value = xaml::ThicknessHelper::FromUniformLength(valueDbl);
} else {
const auto &obj = jsValue.AsObject();
value = xaml::ThicknessHelper::FromLengths(
obj["left"].AsDouble(), obj["top"].AsDouble(), obj["right"].AsDouble(), obj["bottom"].AsDouble());
return;
}
}
inline void ReadValue(JSValue const &jsValue, xaml::CornerRadius &value) noexcept {
if (auto array = jsValue.TryGetArray()) {
if (array->size() == 4) {
value = xaml::CornerRadiusHelper::FromRadii(
(*array)[0].AsDouble(), (*array)[1].AsDouble(), (*array)[2].AsDouble(), (*array)[3].AsDouble());
return;
}
} else if (auto number = jsValue.TryGetDouble()) {
value = xaml::CornerRadiusHelper::FromUniformRadius(*number);
} else if (auto numberInt = jsValue.TryGetInt64()) {
const auto valueDbl = static_cast<double>(*numberInt);
value = xaml::CornerRadiusHelper::FromUniformRadius(valueDbl);
} else {
const auto &obj = jsValue.AsObject();
value = xaml::CornerRadiusHelper::FromRadii(
obj["topLeft"].AsDouble(),
obj["topRight"].AsDouble(),
obj["bottomRight"].AsDouble(),
obj["bottomLeft"].AsDouble());
return;
}
}
inline void ReadValue(JSValue const &jsValue, winrt::Windows::Foundation::Uri &value) noexcept {
value = Uri{winrt::to_hstring(jsValue.AsString())};
}
} // namespace winrt::Microsoft::ReactNative
#endif // MICROSOFT_REACTNATIVE_JSVALUEXAML
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once
#ifndef MICROSOFT_REACTNATIVE_JSVALUEXAML
#define MICROSOFT_REACTNATIVE_JSVALUEXAML
#include "CppWinRTIncludes.h"
#include "JSValue.h"
namespace winrt::Microsoft::ReactNative {
#ifndef CXXUNITTESTS
inline void ReadValue(JSValue const &jsValue, xaml::Media::Brush &value) noexcept {
value = XamlHelper::BrushFrom([&jsValue](IJSValueWriter const &writer) noexcept { jsValue.WriteTo(writer); });
}
inline void ReadValue(JSValue const &jsValue, Windows::UI::Color &value) noexcept {
value = XamlHelper::ColorFrom([&jsValue](IJSValueWriter const &writer) noexcept { jsValue.WriteTo(writer); });
}
#endif
inline void ReadValue(JSValue const &jsValue, xaml::Thickness &value) noexcept {
if (auto array = jsValue.TryGetArray()) {
if (array->size() == 4) {
value = xaml::ThicknessHelper::FromLengths(
(*array)[0].AsDouble(), (*array)[1].AsDouble(), (*array)[2].AsDouble(), (*array)[3].AsDouble());
return;
}
} else if (auto number = jsValue.TryGetDouble()) {
value = xaml::ThicknessHelper::FromUniformLength(*number);
} else if (auto numberInt = jsValue.TryGetInt64()) {
const auto valueDbl = static_cast<double>(*numberInt);
value = xaml::ThicknessHelper::FromUniformLength(valueDbl);
} else {
const auto &obj = jsValue.AsObject();
value = xaml::ThicknessHelper::FromLengths(
obj["left"].AsDouble(), obj["top"].AsDouble(), obj["right"].AsDouble(), obj["bottom"].AsDouble());
return;
}
}
inline void ReadValue(JSValue const &jsValue, xaml::CornerRadius &value) noexcept {
if (auto array = jsValue.TryGetArray()) {
if (array->size() == 4) {
value = xaml::CornerRadiusHelper::FromRadii(
(*array)[0].AsDouble(), (*array)[1].AsDouble(), (*array)[2].AsDouble(), (*array)[3].AsDouble());
return;
}
} else if (auto number = jsValue.TryGetDouble()) {
value = xaml::CornerRadiusHelper::FromUniformRadius(*number);
} else if (auto numberInt = jsValue.TryGetInt64()) {
const auto valueDbl = static_cast<double>(*numberInt);
value = xaml::CornerRadiusHelper::FromUniformRadius(valueDbl);
} else {
const auto &obj = jsValue.AsObject();
value = xaml::CornerRadiusHelper::FromRadii(
obj["topLeft"].AsDouble(),
obj["topRight"].AsDouble(),
obj["bottomRight"].AsDouble(),
obj["bottomLeft"].AsDouble());
return;
}
}
inline void ReadValue(JSValue const &jsValue, winrt::Windows::Foundation::Uri &value) noexcept {
value = Uri{winrt::to_hstring(jsValue.AsString())};
}
} // namespace winrt::Microsoft::ReactNative
#endif // MICROSOFT_REACTNATIVE_JSVALUEXAML

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

@ -1,266 +1,266 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="16.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(SolutionDir)\ExperimentalFeatures.props" Condition="Exists('$(SolutionDir)\ExperimentalFeatures.props')" />
<PropertyGroup>
<CppWinRTVersion Condition="'$(CppWinRTVersion)'==''">2.0.210309.3</CppWinRTVersion>
</PropertyGroup>
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<MinimalCoreWin>true</MinimalCoreWin>
<ProjectGuid>{0ff7027a-222c-4ffb-8f17-91d18bbaf7a8}</ProjectGuid>
<ProjectName>ReactNativeXaml</ProjectName>
<RootNamespace>ReactNativeXaml</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.16299.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="ReactNativeWindowsProps">
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(SolutionDir), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="ReactNativeWindowsPropertySheets">
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\external\Microsoft.ReactNative.Uwp.CppLib.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" />
<Import Project="$(SolutionDir)\packages\$(WinUIPackageProps)" Condition="'$(WinUIPackageProps)'!='' And Exists('$(SolutionDir)\packages\$(WinUIPackageProps)')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<WarningLevel>Level4</WarningLevel>
<AdditionalOptions>%(AdditionalOptions) /bigobj /Zc:lambda /Gw</AdditionalOptions>
<DisableSpecificWarnings>4453;28204;4100;4189</DisableSpecificWarnings>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
<ModuleDefinitionFile>ReactNativeXaml.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</PreprocessToFile>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</RuntimeTypeInfo>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">DebugFull</GenerateDebugInformation>
</Link>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</StringPooling>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MinSpace</Optimization>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</RuntimeTypeInfo>
<PreprocessToFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</PreprocessToFile>
<StringPooling Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</StringPooling>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Full</Optimization>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|x64'">stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<LinkTimeCodeGeneration Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
<Link>
<LinkTimeCodeGeneration Condition="'$(Configuration)|$(Platform)'=='Release|x64'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<EnableCOMDATFolding Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</EnableCOMDATFolding>
</Link>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="Codegen\EventArgsTypeProperties.g.h" />
<ClInclude Include="Codegen\TypeEnums.g.h" />
<ClInclude Include="Codegen\TypeEvents.g.h" />
<ClInclude Include="Codegen\TypeProperties.g.h" />
<ClInclude Include="Codegen\Version.g.h" />
<ClInclude Include="Crc32Str.h" />
<ClInclude Include="JSValueXaml_local.h" />
<ClInclude Include="ReactPackageProvider.h">
<DependentUpon>ReactPackageProvider.idl</DependentUpon>
</ClInclude>
<ClInclude Include="ReactNativeModule.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Serialize.h" />
<ClInclude Include="Styling.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="Wrapper.h">
<DependentUpon>Wrapper.idl</DependentUpon>
<SubType>Code</SubType>
</ClInclude>
<ClInclude Include="XamlMetadata.h" />
<ClInclude Include="XamlObject.h" />
<ClInclude Include="XamlViewManager.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Codegen\TypeCreator.g.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ReactPackageProvider.cpp">
<DependentUpon>ReactPackageProvider.idl</DependentUpon>
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="Serialize.cpp" />
<ClCompile Include="Styling.cpp" />
<ClCompile Include="Wrapper.cpp">
<DependentUpon>Wrapper.idl</DependentUpon>
<SubType>Code</SubType>
</ClCompile>
<ClCompile Include="XamlMetadata.cpp" />
<ClCompile Include="XamlObject.cpp" />
<ClCompile Include="XamlViewManager.cpp" />
</ItemGroup>
<ItemGroup>
<Midl Include="ReactPackageProvider.idl" />
<Midl Include="Wrapper.idl">
<SubType>Designer</SubType>
</Midl>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\README.md" />
<None Include="..\..\..\USAGE.md" />
<None Include="..\..\src\index.ts" />
<None Include="..\..\src\NativeXamlControl.tsx" />
<None Include="..\..\src\Props.ts" />
<None Include="..\..\src\Types.tsx" />
<None Include="..\..\src\Enums.ts" />
<None Include="packages.config" />
<None Include="PropertySheet.props" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ReactNativeXaml.rc" />
</ItemGroup>
<Import Project="$(SolutionDir)\ReactNativeXaml.Imports.props" Condition="Exists('$(SolutionDir)\ReactNativeXaml.Imports.props')" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ReactNativeWindowsTargets">
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" />
</ImportGroup>
<Target Name="EnsureReactNativeWindowsTargets" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references targets in your node_modules\react-native-windows folder that are missing. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props'))" />
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets'))" />
</Target>
<ImportGroup Label="ExtensionTargets">
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="$(SolutionDir)\packages\CDebug.0.0.3\build\CDebug.targets" Condition="Exists('$(SolutionDir)\packages\CDebug.0.0.3\build\CDebug.targets')" />
<Import Project="$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets" Condition="Exists('$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets')" />
<Import Project="$(SolutionDir)\packages\Microsoft.ReactNative.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.targets" Condition="'$(UseExperimentalNuget)'=='true' And Exists('$(SolutionDir)\packages\Microsoft.ReactNative.Cxx.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.Cxx.targets')" />
<Import Project="$(SolutionDir)\packages\Microsoft.ReactNative.Cxx.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.Cxx.targets" Condition="'$(UseExperimentalNuget)'=='true' And Exists('$(SolutionDir)\packages\Microsoft.ReactNative.Cxx.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.Cxx.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\CDebug.0.0.3\build\CDebug.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\CDebug.0.0.3\build\CDebug.targets'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets'))" />
<Error Condition="'$(UseExperimentalNuget)'=='true' And !Exists('$(SolutionDir)\packages\Microsoft.ReactNative.Cxx.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.Cxx.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.ReactNative.Cxx.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.Cxx.targets'))" />
<Error Condition="'$(UseExperimentalNuget)'=='true' And !Exists('$(SolutionDir)\packages\Microsoft.ReactNative.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.ReactNative.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.targets'))" />
</Target>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="16.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(SolutionDir)\ExperimentalFeatures.props" Condition="Exists('$(SolutionDir)\ExperimentalFeatures.props')" />
<PropertyGroup>
<CppWinRTVersion Condition="'$(CppWinRTVersion)'==''">2.0.210309.3</CppWinRTVersion>
</PropertyGroup>
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<MinimalCoreWin>true</MinimalCoreWin>
<ProjectGuid>{0ff7027a-222c-4ffb-8f17-91d18bbaf7a8}</ProjectGuid>
<ProjectName>ReactNativeXaml</ProjectName>
<RootNamespace>ReactNativeXaml</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.16299.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="ReactNativeWindowsProps">
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(SolutionDir), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="ReactNativeWindowsPropertySheets">
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\external\Microsoft.ReactNative.Uwp.CppLib.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" />
<Import Project="$(SolutionDir)\packages\$(WinUIPackageProps)" Condition="'$(WinUIPackageProps)'!='' And Exists('$(SolutionDir)\packages\$(WinUIPackageProps)')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<WarningLevel>Level4</WarningLevel>
<AdditionalOptions>%(AdditionalOptions) /bigobj /Zc:lambda /Gw</AdditionalOptions>
<DisableSpecificWarnings>4453;28204;4100;4189</DisableSpecificWarnings>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
<ModuleDefinitionFile>ReactNativeXaml.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</PreprocessToFile>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</RuntimeTypeInfo>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">DebugFull</GenerateDebugInformation>
</Link>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</StringPooling>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MinSpace</Optimization>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</RuntimeTypeInfo>
<RuntimeTypeInfo Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</RuntimeTypeInfo>
<PreprocessToFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</PreprocessToFile>
<StringPooling Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</StringPooling>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Full</Optimization>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|x64'">stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<LinkTimeCodeGeneration Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
<Link>
<LinkTimeCodeGeneration Condition="'$(Configuration)|$(Platform)'=='Release|x64'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<EnableCOMDATFolding Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</EnableCOMDATFolding>
</Link>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
<ResourceCompile>
<ResourceOutputFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)\ReactNativeXaml.res</ResourceOutputFileName>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="Codegen\EventArgsTypeProperties.g.h" />
<ClInclude Include="Codegen\TypeEnums.g.h" />
<ClInclude Include="Codegen\TypeEvents.g.h" />
<ClInclude Include="Codegen\TypeProperties.g.h" />
<ClInclude Include="Codegen\Version.g.h" />
<ClInclude Include="Crc32Str.h" />
<ClInclude Include="JSValueXaml_local.h" />
<ClInclude Include="ReactPackageProvider.h">
<DependentUpon>ReactPackageProvider.idl</DependentUpon>
</ClInclude>
<ClInclude Include="ReactNativeModule.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Serialize.h" />
<ClInclude Include="Styling.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="Wrapper.h">
<DependentUpon>Wrapper.idl</DependentUpon>
<SubType>Code</SubType>
</ClInclude>
<ClInclude Include="XamlMetadata.h" />
<ClInclude Include="XamlObject.h" />
<ClInclude Include="XamlViewManager.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Codegen\TypeCreator.g.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ReactPackageProvider.cpp">
<DependentUpon>ReactPackageProvider.idl</DependentUpon>
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="Serialize.cpp" />
<ClCompile Include="Styling.cpp" />
<ClCompile Include="Wrapper.cpp">
<DependentUpon>Wrapper.idl</DependentUpon>
<SubType>Code</SubType>
</ClCompile>
<ClCompile Include="XamlMetadata.cpp" />
<ClCompile Include="XamlObject.cpp" />
<ClCompile Include="XamlViewManager.cpp" />
</ItemGroup>
<ItemGroup>
<Midl Include="ReactPackageProvider.idl" />
<Midl Include="Wrapper.idl">
<SubType>Designer</SubType>
</Midl>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\README.md" />
<None Include="..\..\..\USAGE.md" />
<None Include="..\..\src\index.ts" />
<None Include="..\..\src\NativeXamlControl.tsx" />
<None Include="..\..\src\Props.ts" />
<None Include="..\..\src\Types.tsx" />
<None Include="..\..\src\Enums.ts" />
<None Include="packages.config" />
<None Include="PropertySheet.props" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ReactNativeXaml.rc" />
</ItemGroup>
<Import Project="$(SolutionDir)\ReactNativeXaml.Imports.props" Condition="Exists('$(SolutionDir)\ReactNativeXaml.Imports.props')" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ReactNativeWindowsTargets">
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" />
</ImportGroup>
<Target Name="EnsureReactNativeWindowsTargets" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references targets in your node_modules\react-native-windows folder that are missing. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props'))" />
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets'))" />
</Target>
<ImportGroup Label="ExtensionTargets">
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="$(SolutionDir)\packages\CDebug.0.0.3\build\CDebug.targets" Condition="Exists('$(SolutionDir)\packages\CDebug.0.0.3\build\CDebug.targets')" />
<Import Project="$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets" Condition="Exists('$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets')" />
<Import Project="$(SolutionDir)\packages\Microsoft.ReactNative.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.targets" Condition="'$(UseExperimentalNuget)'=='true' And Exists('$(SolutionDir)\packages\Microsoft.ReactNative.Cxx.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.Cxx.targets')" />
<Import Project="$(SolutionDir)\packages\Microsoft.ReactNative.Cxx.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.Cxx.targets" Condition="'$(UseExperimentalNuget)'=='true' And Exists('$(SolutionDir)\packages\Microsoft.ReactNative.Cxx.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.Cxx.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.$(CppWinRTVersion)\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\CDebug.0.0.3\build\CDebug.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\CDebug.0.0.3\build\CDebug.targets'))" />
<Error Condition="!Exists('$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\$(WinUIPackageName).$(WinUIPackageVersion)\build\native\$(WinUIPackageName).targets'))" />
<Error Condition="'$(UseExperimentalNuget)'=='true' And !Exists('$(SolutionDir)\packages\Microsoft.ReactNative.Cxx.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.Cxx.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.ReactNative.Cxx.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.Cxx.targets'))" />
<Error Condition="'$(UseExperimentalNuget)'=='true' And !Exists('$(SolutionDir)\packages\Microsoft.ReactNative.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.ReactNative.$(ReactNativeWindowsVersion)\build\native\Microsoft.ReactNative.targets'))" />
</Target>
</Project>

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

@ -1,81 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Midl Include="ReactPackageProvider.idl" />
<Midl Include="Wrapper.idl" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="ReactPackageProvider.cpp" />
<ClCompile Include="XamlViewManager.cpp" />
<ClCompile Include="XamlMetadata.cpp" />
<ClCompile Include="Codegen\TypeCreator.g.cpp">
<Filter>Codegen</Filter>
</ClCompile>
<ClCompile Include="Serialize.cpp" />
<ClCompile Include="Styling.cpp" />
<ClCompile Include="XamlObject.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="ReactPackageProvider.h" />
<ClInclude Include="ReactNativeModule.h" />
<ClInclude Include="XamlViewManager.h" />
<ClInclude Include="XamlMetadata.h" />
<ClInclude Include="Crc32Str.h" />
<ClInclude Include="Codegen\TypeProperties.g.h">
<Filter>Codegen</Filter>
</ClInclude>
<ClInclude Include="Codegen\TypeEvents.g.h">
<Filter>Codegen</Filter>
</ClInclude>
<ClInclude Include="Serialize.h" />
<ClInclude Include="Styling.h" />
<ClInclude Include="XamlObject.h" />
<ClInclude Include="Codegen\EventArgsTypeProperties.g.h">
<Filter>Codegen</Filter>
</ClInclude>
<ClInclude Include="Codegen\TypeEnums.g.h">
<Filter>Codegen</Filter>
</ClInclude>
<ClInclude Include="JSValueXaml_local.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Codegen\Version.g.h">
<Filter>Codegen</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
<None Include="..\..\src\index.ts">
<Filter>TS</Filter>
</None>
<None Include="..\..\src\NativeXamlControl.tsx">
<Filter>TS</Filter>
</None>
<None Include="..\..\src\Props.ts">
<Filter>TS</Filter>
</None>
<None Include="..\..\src\Types.tsx">
<Filter>TS</Filter>
</None>
<None Include="..\..\..\README.md" />
<None Include="packages.config" />
<None Include="..\..\..\USAGE.md" />
<None Include="..\..\src\Enums.ts">
<Filter>TS</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Filter Include="Codegen">
<UniqueIdentifier>{0ef07389-5c8a-4c8b-9570-1cf9a2153ce5}</UniqueIdentifier>
</Filter>
<Filter Include="TS">
<UniqueIdentifier>{5c572e8a-9a91-412d-8a35-4bd65c3cfa2b}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ReactNativeXaml.rc" />
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Midl Include="ReactPackageProvider.idl" />
<Midl Include="Wrapper.idl" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="ReactPackageProvider.cpp" />
<ClCompile Include="XamlViewManager.cpp" />
<ClCompile Include="XamlMetadata.cpp" />
<ClCompile Include="Codegen\TypeCreator.g.cpp">
<Filter>Codegen</Filter>
</ClCompile>
<ClCompile Include="Serialize.cpp" />
<ClCompile Include="Styling.cpp" />
<ClCompile Include="XamlObject.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="ReactPackageProvider.h" />
<ClInclude Include="ReactNativeModule.h" />
<ClInclude Include="XamlViewManager.h" />
<ClInclude Include="XamlMetadata.h" />
<ClInclude Include="Crc32Str.h" />
<ClInclude Include="Codegen\TypeProperties.g.h">
<Filter>Codegen</Filter>
</ClInclude>
<ClInclude Include="Codegen\TypeEvents.g.h">
<Filter>Codegen</Filter>
</ClInclude>
<ClInclude Include="Serialize.h" />
<ClInclude Include="Styling.h" />
<ClInclude Include="XamlObject.h" />
<ClInclude Include="Codegen\EventArgsTypeProperties.g.h">
<Filter>Codegen</Filter>
</ClInclude>
<ClInclude Include="Codegen\TypeEnums.g.h">
<Filter>Codegen</Filter>
</ClInclude>
<ClInclude Include="JSValueXaml_local.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Codegen\Version.g.h">
<Filter>Codegen</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
<None Include="..\..\src\index.ts">
<Filter>TS</Filter>
</None>
<None Include="..\..\src\NativeXamlControl.tsx">
<Filter>TS</Filter>
</None>
<None Include="..\..\src\Props.ts">
<Filter>TS</Filter>
</None>
<None Include="..\..\src\Types.tsx">
<Filter>TS</Filter>
</None>
<None Include="..\..\..\README.md" />
<None Include="packages.config" />
<None Include="..\..\..\USAGE.md" />
<None Include="..\..\src\Enums.ts">
<Filter>TS</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Filter Include="Codegen">
<UniqueIdentifier>{0ef07389-5c8a-4c8b-9570-1cf9a2153ce5}</UniqueIdentifier>
</Filter>
<Filter Include="TS">
<UniqueIdentifier>{5c572e8a-9a91-412d-8a35-4bd65c3cfa2b}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ReactNativeXaml.rc" />
</ItemGroup>
</Project>

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

@ -1,382 +1,382 @@
#include "pch.h"
#include <roapi.h>
#include "XamlMetadata.h"
#include <JSValueReader.h>
#include <filesystem>
#include <unordered_map>
#include <Crc32Str.h>
#include <xutility>
#include "Codegen/TypeProperties.g.h"
#include "Codegen/TypeEvents.g.h"
#include <JSValueWriter.h>
#include "Serialize.h"
#include <UI.Xaml.Documents.h>
#include <JSI/JsiApiContext.h>
#include "XamlViewManager.h"
#include "Styling.h"
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.Security.Cryptography.h>
#include <cdebug.h>
namespace jsi = facebook::jsi;
using namespace winrt;
using namespace winrt::Microsoft::ReactNative;
#define MAKE_GET_DP(type, prop) IsType<type>, []() { return type::prop(); }
void XamlMetadata::SetupEventDispatcher(const IReactContext& reactContext) {
m_reactContext = reactContext;
std::once_flag inited;
std::call_once(inited, [ctx = reactContext, this]() {
ExecuteJsi(ctx, [shared = shared_from_this()](facebook::jsi::Runtime& rt) {
auto obj = rt.global().createFromHostObject(rt, std::make_shared<XamlObject>());
rt.global().setProperty(rt, jsi::PropNameID::forAscii(rt, "xaml"), obj);
auto batchedBridge = rt.global().getProperty(rt, "__fbBatchedBridge");
if (!batchedBridge.isUndefined() && batchedBridge.isObject()) {
if (auto vm = shared.get()) {
vm->m_callFunctionReturnFlushedQueue = batchedBridge.asObject(rt).getPropertyAsFunction(
rt, "callFunctionReturnFlushedQueue");
}
}
});
});
}
FrameworkElement Wrap(const winrt::Windows::Foundation::IInspectable& d) {
if (auto fe = d.try_as<FrameworkElement>()) {
return fe;
}
else {
winrt::ReactNativeXaml::Wrapper wrapper{};
wrapper.WrappedObject(d);
return wrapper;
}
}
winrt::Windows::Foundation::IInspectable XamlMetadata::Create(const std::string& typeName, const winrt::Microsoft::ReactNative::IReactContext& context) {
auto key = COMPILE_TIME_CRC32_STR(typeName.c_str());
auto obj = Create(typeName);
auto e = obj.try_as<FrameworkElement>();
bool wrapped = e == nullptr;
if (!e) {
e = Wrap(obj);
wrapperToWrapped.emplace(e, WrapperInfo{ obj, {} });
}
else {
wrapperToWrapped.emplace(e, WrapperInfo{ nullptr, {} });
}
return e;
}
FrameworkElement XamlMetadata::GetFlyoutTarget(winrt::Windows::Foundation::IInspectable flyout) const {
auto it = std::find_if(wrapperToWrapped.begin(), wrapperToWrapped.end(), [flyout](auto& entry) {
WrapperInfo wrapperInfo = entry.second;
return wrapperInfo.wrappedObject == flyout;
});
if (it != wrapperToWrapped.end()) {
auto parent = it->first.as<ReactNativeXaml::Wrapper>().DataContext();
return parent.as<FrameworkElement>();
}
return nullptr;
}
// FlyoutBase.IsOpen is read-only but we need a way to call ShowAt/Hide, so this hooks it up
void SetIsOpen_FlyoutBase(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& context) {
const auto& xaml = context.Properties().Get(ReactNativeXaml::XamlViewManager::XamlViewManagerProperty().Handle()).as<ReactNativeXaml::XamlViewManager>();
auto flyout = o.try_as<Controls::Primitives::FlyoutBase>();
if (flyout && v.Type() == JSValueType::Boolean) {
if (v.AsBoolean()) {
auto target = flyout.Target();
if (!target) {
target = xaml->Metadata()->GetFlyoutTarget(o);
}
if (target) {
auto cn = winrt::get_class_name(target);
flyout.ShowAt(target);
}
else {
cdebug << "Couldn't determine flyout target\n";
}
}
else {
flyout.Hide();
}
}
}
void SetText_Run(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
if (auto run = o.try_as<Documents::Run>()) {
run.Text(winrt::to_hstring(v.AsString()));
}
}
void SetNavigateUri_Hyperlink(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
if (auto hyperlink = o.try_as<Documents::Hyperlink>()) {
hyperlink.NavigateUri(winrt::Windows::Foundation::Uri{ winrt::to_hstring(v.AsString()) });
}
}
GridLength GetGridLength(const winrt::Microsoft::ReactNative::JSValue& v) {
if (v.Type() == JSValueType::Double || v.Type() == JSValueType::Int64) {
return GridLengthHelper::FromValueAndType(v.AsDouble(), GridUnitType::Pixel);
}
else if (v.Type() == JSValueType::String) {
auto str = v.AsString();
double units = 1;
GridUnitType unitType = GridUnitType::Pixel;
if (str.back() == '*') {
unitType = GridUnitType::Star;
str.pop_back();
if (str.length() > 0) {
units = std::stod(str);
}
}
else if (str == "auto") {
unitType = GridUnitType::Auto;
}
else {
units = std::stod(str);
}
return GridLengthHelper::FromValueAndType(units, unitType);
}
return GridLengthHelper::FromValueAndType(1, GridUnitType::Auto);
}
void SetGridLayout_Grid(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
if (auto grid = o.try_as<Grid>()) {
const auto& cols = v.AsObject()["columns"].AsArray();
const auto& rows = v.AsObject()["rows"].AsArray();
grid.ColumnDefinitions().Clear();
grid.RowDefinitions().Clear();
for (const auto& col : cols) {
ColumnDefinition cd;
cd.Width(GetGridLength(col));
grid.ColumnDefinitions().Append(cd);
}
for (const auto& row : rows) {
RowDefinition rd;
rd.Height(GetGridLength(row));
grid.RowDefinitions().Append(rd);
}
}
}
void SetResources_UIElement(const xaml::DependencyObject& dobj, const xaml::DependencyProperty&, const JSValue& jsValue, const winrt::Microsoft::ReactNative::IReactContext&) {
ResourceDictionary rd;
const auto& dict = jsValue.AsObject();
const auto fe = dobj.as<FrameworkElement>();
for (auto const& entry : dict) {
const auto& name = entry.first;
const auto& value = entry.second;
auto brush = ColorUtils::BrushFrom(value);
auto nameII = winrt::box_value(winrt::to_hstring(name));
rd.Insert(nameII, brush);
if (auto v = rd.TryLookup(nameII)) {
if (auto scb = v.try_as<xaml::Media::SolidColorBrush>()) {
if (auto newScb = brush.try_as<xaml::Media::SolidColorBrush>()) {
scb.Color(newScb.Color());
continue;
}
else {
assert(false && "changing from a color to a non-color brush");
}
}
else {
assert(false && "changing from a non-color brush");
}
}
}
fe.Resources(rd);
}
void SetShowState_ContentDialog(const xaml::DependencyObject& dobj, const xaml::DependencyProperty&, const JSValue& jsValue, const winrt::Microsoft::ReactNative::IReactContext& context) {
if (auto cd = dobj.try_as<ContentDialog>()) {
auto val = jsValue.AsInt32();
IAsyncOperation<ContentDialogResult> op{ nullptr };
switch (val) {
case 0: // Popup
op = cd.ShowAsync(ContentDialogPlacement::Popup);
break;
case 1: // InPlace
op = cd.ShowAsync(ContentDialogPlacement::InPlace);
break;
case 3: // Hidden
return cd.Hide();
}
}
}
const xaml::Interop::TypeName viewPanelTypeName{ winrt::hstring{L"ViewPanel"}, xaml::Interop::TypeKind::Metadata };
xaml::DependencyProperty GetPriorityProperty() {
static const auto priority = DependencyProperty::RegisterAttached(L"Priority", winrt::xaml_typename<uint32_t>(), viewPanelTypeName, xaml::PropertyMetadata{ winrt::box_value(0u) });
return priority;
}
void SetPriority_DependencyObject(const DependencyObject& u, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& reactContext) {
const auto priorityValue = v.AsUInt32();
u.SetValue(GetPriorityProperty(), winrt::box_value(priorityValue));
}
const PropInfo* XamlMetadata::FindFirstMatch(const stringKey& key, const winrt::Windows::Foundation::IInspectable& obj, const PropInfo* map, size_t size) {
auto it = std::find_if(map, map + size, [key](const PropInfo& entry) { return Equals(entry.propName, key); });
while ((it != map + size) && Equals(it->propName, key)) {
if (it->asType(obj)) {
return it;
}
it++;
}
return nullptr;
}
const struct {
const PropInfo* map;
size_t size;
} propertyMaps[] = {
{ xamlPropertyMap, ARRAYSIZE(xamlPropertyMap) },
{ fakeProps, ARRAYSIZE(fakeProps) }
};
const PropInfo* XamlMetadata::GetProp(const std::string& propertyName, const winrt::Windows::Foundation::IInspectable& obj) const {
auto key = MAKE_KEY(propertyName.c_str());
for (const auto& mapInfo : propertyMaps) {
auto it = FindFirstMatch(key, obj, mapInfo.map, mapInfo.size);
if (it) return it;
}
return nullptr;
}
// wrapper -> flyout via wrapperToWrapped
const EventInfo* XamlMetadata::AttachEvent(const winrt::Microsoft::ReactNative::IReactContext& context,
const std::string& propertyName, const winrt::Windows::Foundation::IInspectable& obj, bool attaching) {
// obj is always a FrameworkElement (either a control or a wrapped control)
if (!propertyName._Starts_with("on")) return nullptr;
const std::string evtName = propertyName.substr(2);
auto key = MAKE_KEY(evtName.data());
auto e = obj.try_as<FrameworkElement>();
auto wrapper = wrapperToWrapped.find(e);
bool isWrapped = wrapper != wrapperToWrapped.end() && wrapper->second.wrappedObject != nullptr;
auto attachedEvt = std::find_if(wrapper->second.events.cbegin(), wrapper->second.events.cend(),
[&evtName](AttachedEventInfo const& ei) { return ei.name == evtName; });
winrt::event_token token{ 0 };
if (attachedEvt != wrapper->second.events.cend()) {
token = attachedEvt->token;
}
if (!attaching) {
wrapper->second.events.erase(attachedEvt);
}
EventAttachInfo eai{ context, e, "top" + evtName, *this };
for (const auto& entry : EventInfo::xamlEventMap) {
if (Equals(MAKE_KEY(entry.name), key)) {
if (!entry.attachHandler) {
// this is a synthetic event. it will only be raised programmatically, there is no equivalent native event
return &entry;
}
auto attached = entry.attachHandler(eai, isWrapped, token);
if (attached == winrt::event_token{ -1 } && !attaching) {
return &entry;
}
else if (attached) {
wrapper->second.events.push_back({ evtName, attached });
return &entry;
}
}
}
return nullptr;
}
void XamlMetadata::JsiDispatchEvent(jsi::Runtime& rt, int64_t viewTag, std::string&& eventName, std::shared_ptr<facebook::jsi::Object>& eventData) const noexcept {
auto params = jsi::Array(rt, 3);
params.setValueAtIndex(rt, 0, static_cast<int>(viewTag));
params.setValueAtIndex(rt, 1, eventName);
params.setValueAtIndex(rt, 2, *eventData.get());
m_callFunctionReturnFlushedQueue->call(rt, "RCTEventEmitter", "receiveEvent", params);
}
void XamlMetadata::PopulateNativeProps(std::vector<std::string>& names, const winrt::Windows::Foundation::IInspectable& obj) const {
if (auto dobj = obj.try_as<DependencyObject>()) {
for (auto const& map : propertyMaps) {
for (auto e = map.map; e != map.map + map.size; e++) {
if (auto cast = e->asType(obj)) {
names.push_back(e->propName);
}
}
}
}
else if (auto rea = obj.try_as<xaml::RoutedEventArgs>()) {
auto cn = winrt::get_class_name(rea);
auto trea = rea.try_as<xaml::Input::TappedRoutedEventArgs>();
}
}
winrt::IAsyncOperation<winrt::Windows::Storage::Streams::InMemoryRandomAccessStream> GetImageInlineDataAsync(const std::string& uri) {
size_t start = uri.find(',');
if (start == std::string::npos || start + 1 > uri.length())
co_return nullptr;
try {
co_await winrt::resume_background();
std::string_view base64String(uri.c_str() + start + 1, uri.length() - start - 1);
auto buffer =
winrt::Windows::Security::Cryptography::CryptographicBuffer::DecodeFromBase64String(winrt::to_hstring(base64String));
winrt::Windows::Storage::Streams::InMemoryRandomAccessStream memoryStream;
auto b = memoryStream.CanWrite();
co_await memoryStream.WriteAsync(buffer);
memoryStream.Seek(0);
co_return memoryStream;
}
catch (winrt::hresult_error const&) {
// Base64 decode failed
}
co_return nullptr;
}
winrt::fire_and_forget winrt::Microsoft::ReactNative::SetImageSourceForInlineData(std::string str, xaml::DependencyObject o, xaml::DependencyProperty dp) {
// inline data
const auto streamOp = GetImageInlineDataAsync(str);
auto stream = co_await streamOp;
xaml::Media::ImageSource source{ nullptr };
if (str.find("image/svg+xml;base64") != std::string::npos) {
auto src = xaml::Media::Imaging::SvgImageSource();
co_await src.SetSourceAsync(stream);
source = src;
}
else if (str.find("image/png;base64") != std::string::npos) {
auto src = xaml::Media::Imaging::BitmapImage();
co_await src.SetSourceAsync(stream);
source = src;
}
o.SetValue(dp, source);
}
void XamlMetadata::DispatchCommand(FrameworkElement const& view, winrt::hstring const& commandId, const winrt::Microsoft::ReactNative::JSValueArray& args) const noexcept {
const std::string name = winrt::to_string(commandId);
auto it = std::find_if(xamlCommands, xamlCommands + std::size(xamlCommands), [name](const XamlCommand& entry) { return Equals(entry.name, name.c_str()); });
if (it != xamlCommands + std::size(xamlCommands)) {
it->pfn(view, args, *this);
}
#include "pch.h"
#include <roapi.h>
#include "XamlMetadata.h"
#include <JSValueReader.h>
#include <filesystem>
#include <unordered_map>
#include <Crc32Str.h>
#include <xutility>
#include "Codegen/TypeProperties.g.h"
#include "Codegen/TypeEvents.g.h"
#include <JSValueWriter.h>
#include "Serialize.h"
#include <UI.Xaml.Documents.h>
#include <JSI/JsiApiContext.h>
#include "XamlViewManager.h"
#include "Styling.h"
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.Security.Cryptography.h>
#include <cdebug.h>
namespace jsi = facebook::jsi;
using namespace winrt;
using namespace winrt::Microsoft::ReactNative;
#define MAKE_GET_DP(type, prop) IsType<type>, []() { return type::prop(); }
void XamlMetadata::SetupEventDispatcher(const IReactContext& reactContext) {
m_reactContext = reactContext;
std::once_flag inited;
std::call_once(inited, [ctx = reactContext, this]() {
ExecuteJsi(ctx, [shared = shared_from_this()](facebook::jsi::Runtime& rt) {
auto obj = rt.global().createFromHostObject(rt, std::make_shared<XamlObject>());
rt.global().setProperty(rt, jsi::PropNameID::forAscii(rt, "xaml"), obj);
auto batchedBridge = rt.global().getProperty(rt, "__fbBatchedBridge");
if (!batchedBridge.isUndefined() && batchedBridge.isObject()) {
if (auto vm = shared.get()) {
vm->m_callFunctionReturnFlushedQueue = batchedBridge.asObject(rt).getPropertyAsFunction(
rt, "callFunctionReturnFlushedQueue");
}
}
});
});
}
FrameworkElement Wrap(const winrt::Windows::Foundation::IInspectable& d) {
if (auto fe = d.try_as<FrameworkElement>()) {
return fe;
}
else {
winrt::ReactNativeXaml::Wrapper wrapper{};
wrapper.WrappedObject(d);
return wrapper;
}
}
winrt::Windows::Foundation::IInspectable XamlMetadata::Create(const std::string& typeName, const winrt::Microsoft::ReactNative::IReactContext& context) {
auto key = COMPILE_TIME_CRC32_STR(typeName.c_str());
auto obj = Create(typeName);
auto e = obj.try_as<FrameworkElement>();
bool wrapped = e == nullptr;
if (!e) {
e = Wrap(obj);
wrapperToWrapped.emplace(e, WrapperInfo{ obj, {} });
}
else {
wrapperToWrapped.emplace(e, WrapperInfo{ nullptr, {} });
}
return e;
}
FrameworkElement XamlMetadata::GetFlyoutTarget(winrt::Windows::Foundation::IInspectable flyout) const {
auto it = std::find_if(wrapperToWrapped.begin(), wrapperToWrapped.end(), [flyout](auto& entry) {
WrapperInfo wrapperInfo = entry.second;
return wrapperInfo.wrappedObject == flyout;
});
if (it != wrapperToWrapped.end()) {
auto parent = it->first.as<ReactNativeXaml::Wrapper>().DataContext();
return parent.as<FrameworkElement>();
}
return nullptr;
}
// FlyoutBase.IsOpen is read-only but we need a way to call ShowAt/Hide, so this hooks it up
void SetIsOpen_FlyoutBase(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& context) {
const auto& xaml = context.Properties().Get(ReactNativeXaml::XamlViewManager::XamlViewManagerProperty().Handle()).as<ReactNativeXaml::XamlViewManager>();
auto flyout = o.try_as<Controls::Primitives::FlyoutBase>();
if (flyout && v.Type() == JSValueType::Boolean) {
if (v.AsBoolean()) {
auto target = flyout.Target();
if (!target) {
target = xaml->Metadata()->GetFlyoutTarget(o);
}
if (target) {
auto cn = winrt::get_class_name(target);
flyout.ShowAt(target);
}
else {
cdebug << "Couldn't determine flyout target\n";
}
}
else {
flyout.Hide();
}
}
}
void SetText_Run(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
if (auto run = o.try_as<Documents::Run>()) {
run.Text(winrt::to_hstring(v.AsString()));
}
}
void SetNavigateUri_Hyperlink(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
if (auto hyperlink = o.try_as<Documents::Hyperlink>()) {
hyperlink.NavigateUri(winrt::Windows::Foundation::Uri{ winrt::to_hstring(v.AsString()) });
}
}
GridLength GetGridLength(const winrt::Microsoft::ReactNative::JSValue& v) {
if (v.Type() == JSValueType::Double || v.Type() == JSValueType::Int64) {
return GridLengthHelper::FromValueAndType(v.AsDouble(), GridUnitType::Pixel);
}
else if (v.Type() == JSValueType::String) {
auto str = v.AsString();
double units = 1;
GridUnitType unitType = GridUnitType::Pixel;
if (str.back() == '*') {
unitType = GridUnitType::Star;
str.pop_back();
if (str.length() > 0) {
units = std::stod(str);
}
}
else if (str == "auto") {
unitType = GridUnitType::Auto;
}
else {
units = std::stod(str);
}
return GridLengthHelper::FromValueAndType(units, unitType);
}
return GridLengthHelper::FromValueAndType(1, GridUnitType::Auto);
}
void SetGridLayout_Grid(const xaml::DependencyObject& o, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
if (auto grid = o.try_as<Grid>()) {
const auto& cols = v.AsObject()["columns"].AsArray();
const auto& rows = v.AsObject()["rows"].AsArray();
grid.ColumnDefinitions().Clear();
grid.RowDefinitions().Clear();
for (const auto& col : cols) {
ColumnDefinition cd;
cd.Width(GetGridLength(col));
grid.ColumnDefinitions().Append(cd);
}
for (const auto& row : rows) {
RowDefinition rd;
rd.Height(GetGridLength(row));
grid.RowDefinitions().Append(rd);
}
}
}
void SetResources_UIElement(const xaml::DependencyObject& dobj, const xaml::DependencyProperty&, const JSValue& jsValue, const winrt::Microsoft::ReactNative::IReactContext&) {
ResourceDictionary rd;
const auto& dict = jsValue.AsObject();
const auto fe = dobj.as<FrameworkElement>();
for (auto const& entry : dict) {
const auto& name = entry.first;
const auto& value = entry.second;
auto brush = ColorUtils::BrushFrom(value);
auto nameII = winrt::box_value(winrt::to_hstring(name));
rd.Insert(nameII, brush);
if (auto v = rd.TryLookup(nameII)) {
if (auto scb = v.try_as<xaml::Media::SolidColorBrush>()) {
if (auto newScb = brush.try_as<xaml::Media::SolidColorBrush>()) {
scb.Color(newScb.Color());
continue;
}
else {
assert(false && "changing from a color to a non-color brush");
}
}
else {
assert(false && "changing from a non-color brush");
}
}
}
fe.Resources(rd);
}
void SetShowState_ContentDialog(const xaml::DependencyObject& dobj, const xaml::DependencyProperty&, const JSValue& jsValue, const winrt::Microsoft::ReactNative::IReactContext& context) {
if (auto cd = dobj.try_as<ContentDialog>()) {
auto val = jsValue.AsInt32();
IAsyncOperation<ContentDialogResult> op{ nullptr };
switch (val) {
case 0: // Popup
op = cd.ShowAsync(ContentDialogPlacement::Popup);
break;
case 1: // InPlace
op = cd.ShowAsync(ContentDialogPlacement::InPlace);
break;
case 3: // Hidden
return cd.Hide();
}
}
}
const xaml::Interop::TypeName viewPanelTypeName{ winrt::hstring{L"ViewPanel"}, xaml::Interop::TypeKind::Metadata };
xaml::DependencyProperty GetPriorityProperty() {
static const auto priority = DependencyProperty::RegisterAttached(L"Priority", winrt::xaml_typename<uint32_t>(), viewPanelTypeName, xaml::PropertyMetadata{ winrt::box_value(0u) });
return priority;
}
void SetPriority_DependencyObject(const DependencyObject& u, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& reactContext) {
const auto priorityValue = v.AsUInt32();
u.SetValue(GetPriorityProperty(), winrt::box_value(priorityValue));
}
const PropInfo* XamlMetadata::FindFirstMatch(const stringKey& key, const winrt::Windows::Foundation::IInspectable& obj, const PropInfo* map, size_t size) {
auto it = std::find_if(map, map + size, [key](const PropInfo& entry) { return Equals(entry.propName, key); });
while ((it != map + size) && Equals(it->propName, key)) {
if (it->asType(obj)) {
return it;
}
it++;
}
return nullptr;
}
const struct {
const PropInfo* map;
size_t size;
} propertyMaps[] = {
{ xamlPropertyMap, ARRAYSIZE(xamlPropertyMap) },
{ fakeProps, ARRAYSIZE(fakeProps) }
};
const PropInfo* XamlMetadata::GetProp(const std::string& propertyName, const winrt::Windows::Foundation::IInspectable& obj) const {
auto key = MAKE_KEY(propertyName.c_str());
for (const auto& mapInfo : propertyMaps) {
auto it = FindFirstMatch(key, obj, mapInfo.map, mapInfo.size);
if (it) return it;
}
return nullptr;
}
// wrapper -> flyout via wrapperToWrapped
const EventInfo* XamlMetadata::AttachEvent(const winrt::Microsoft::ReactNative::IReactContext& context,
const std::string& propertyName, const winrt::Windows::Foundation::IInspectable& obj, bool attaching) {
// obj is always a FrameworkElement (either a control or a wrapped control)
if (!propertyName._Starts_with("on")) return nullptr;
const std::string evtName = propertyName.substr(2);
auto key = MAKE_KEY(evtName.data());
auto e = obj.try_as<FrameworkElement>();
auto wrapper = wrapperToWrapped.find(e);
bool isWrapped = wrapper != wrapperToWrapped.end() && wrapper->second.wrappedObject != nullptr;
auto attachedEvt = std::find_if(wrapper->second.events.cbegin(), wrapper->second.events.cend(),
[&evtName](AttachedEventInfo const& ei) { return ei.name == evtName; });
winrt::event_token token{ 0 };
if (attachedEvt != wrapper->second.events.cend()) {
token = attachedEvt->token;
}
if (!attaching) {
wrapper->second.events.erase(attachedEvt);
}
EventAttachInfo eai{ context, e, "top" + evtName, *this };
for (const auto& entry : EventInfo::xamlEventMap) {
if (Equals(MAKE_KEY(entry.name), key)) {
if (!entry.attachHandler) {
// this is a synthetic event. it will only be raised programmatically, there is no equivalent native event
return &entry;
}
auto attached = entry.attachHandler(eai, isWrapped, token);
if (attached == winrt::event_token{ -1 } && !attaching) {
return &entry;
}
else if (attached) {
wrapper->second.events.push_back({ evtName, attached });
return &entry;
}
}
}
return nullptr;
}
void XamlMetadata::JsiDispatchEvent(jsi::Runtime& rt, int64_t viewTag, std::string&& eventName, std::shared_ptr<facebook::jsi::Object>& eventData) const noexcept {
auto params = jsi::Array(rt, 3);
params.setValueAtIndex(rt, 0, static_cast<int>(viewTag));
params.setValueAtIndex(rt, 1, eventName);
params.setValueAtIndex(rt, 2, *eventData.get());
m_callFunctionReturnFlushedQueue->call(rt, "RCTEventEmitter", "receiveEvent", params);
}
void XamlMetadata::PopulateNativeProps(std::vector<std::string>& names, const winrt::Windows::Foundation::IInspectable& obj) const {
if (auto dobj = obj.try_as<DependencyObject>()) {
for (auto const& map : propertyMaps) {
for (auto e = map.map; e != map.map + map.size; e++) {
if (auto cast = e->asType(obj)) {
names.push_back(e->propName);
}
}
}
}
else if (auto rea = obj.try_as<xaml::RoutedEventArgs>()) {
auto cn = winrt::get_class_name(rea);
auto trea = rea.try_as<xaml::Input::TappedRoutedEventArgs>();
}
}
winrt::IAsyncOperation<winrt::Windows::Storage::Streams::InMemoryRandomAccessStream> GetImageInlineDataAsync(const std::string& uri) {
size_t start = uri.find(',');
if (start == std::string::npos || start + 1 > uri.length())
co_return nullptr;
try {
co_await winrt::resume_background();
std::string_view base64String(uri.c_str() + start + 1, uri.length() - start - 1);
auto buffer =
winrt::Windows::Security::Cryptography::CryptographicBuffer::DecodeFromBase64String(winrt::to_hstring(base64String));
winrt::Windows::Storage::Streams::InMemoryRandomAccessStream memoryStream;
auto b = memoryStream.CanWrite();
co_await memoryStream.WriteAsync(buffer);
memoryStream.Seek(0);
co_return memoryStream;
}
catch (winrt::hresult_error const&) {
// Base64 decode failed
}
co_return nullptr;
}
winrt::fire_and_forget winrt::Microsoft::ReactNative::SetImageSourceForInlineData(std::string str, xaml::DependencyObject o, xaml::DependencyProperty dp) {
// inline data
const auto streamOp = GetImageInlineDataAsync(str);
auto stream = co_await streamOp;
xaml::Media::ImageSource source{ nullptr };
if (str.find("image/svg+xml;base64") != std::string::npos) {
auto src = xaml::Media::Imaging::SvgImageSource();
co_await src.SetSourceAsync(stream);
source = src;
}
else if (str.find("image/png;base64") != std::string::npos) {
auto src = xaml::Media::Imaging::BitmapImage();
co_await src.SetSourceAsync(stream);
source = src;
}
o.SetValue(dp, source);
}
void XamlMetadata::DispatchCommand(FrameworkElement const& view, winrt::hstring const& commandId, const winrt::Microsoft::ReactNative::JSValueArray& args) const noexcept {
const std::string name = winrt::to_string(commandId);
auto it = std::find_if(xamlCommands, xamlCommands + std::size(xamlCommands), [name](const XamlCommand& entry) { return Equals(entry.name, name.c_str()); });
if (it != xamlCommands + std::size(xamlCommands)) {
it->pfn(view, args, *this);
}
}

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

@ -1,249 +1,249 @@
#pragma once
#include <pch.h>
#include <functional>
#include <string>
#include <JSValue.h>
#include <JSValueReader.h>
#include <JSValueXaml_local.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.UI.Xaml.Controls.Maps.h>
#include <winrt/Windows.Media.Playback.h>
#include <winrt/Windows.Media.Core.h>
#include <UI.Xaml.Media.Imaging.h>
#include <UI.Xaml.Media.h>
#include "Crc32Str.h"
#include <JSI/JsiApiContext.h>
#include "XamlObject.h"
#include <Wrapper.h>
using namespace xaml;
using namespace xaml::Controls;
using namespace winrt::Microsoft::ReactNative;
namespace winrt::Microsoft::ReactNative {
inline void ReadValue(JSValue const& jsValue, xaml::Style& value) noexcept {
auto key = winrt::to_hstring(jsValue.AsJSString());
value = Application::Current().Resources().Lookup(winrt::box_value(key)).as<Style>();
}
inline void ReadValue(JSValue const& jsValue, xaml::Media::SolidColorBrush& value) noexcept {
auto color = XamlHelper::ColorFrom([&jsValue](IJSValueWriter const& writer) noexcept { jsValue.WriteTo(writer); });
value = xaml::Media::SolidColorBrush(color);
}
inline void ReadValue(JSValue const& jsValue, xaml::Media::FontFamily& value) noexcept {
auto str = winrt::to_hstring(jsValue.AsString());
value = xaml::Media::FontFamily(str);
}
inline void ReadValue(JSValue const& jsValue, Windows::Media::Playback::IMediaPlaybackSource& value) noexcept {
const auto uri = Uri{ winrt::to_hstring(jsValue.AsString()) };
auto source = Windows::Media::Core::MediaSource::CreateFromUri(uri);
value = source;
}
winrt::fire_and_forget SetImageSourceForInlineData(std::string str, xaml::DependencyObject o, xaml::DependencyProperty dp);
enum class XamlPropType {
Boolean,
Int,
Double,
String,
Object,
Enum,
};
template <typename T> bool IsType(const winrt::Windows::Foundation::IInspectable& i) { return i.try_as<T>() != nullptr; }
template<typename T, std::enable_if_t<std::is_enum<T>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
auto valueEnum = MakeEnum<T>(v.AsInt32());
o.SetValue(prop, valueEnum);
}
template<typename T, std::enable_if_t<
!std::is_enum<T>::value &&
!std::is_same<winrt::hstring, T>::value &&
!std::is_same<winrt::Windows::Foundation::IInspectable, T>::value &&
!std::is_same<winrt::Windows::Foundation::Uri, T>::value &&
!std::is_same<xaml::Media::ImageSource, T>::value
, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
auto b = v.To<T>();
o.SetValue(prop, winrt::box_value(b));
}
template<typename T, std::enable_if_t<
std::is_same<xaml::Media::ImageSource, T>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
const auto str = v.AsString();
const auto uri = Uri{ winrt::to_hstring(str) };
xaml::Media::ImageSource value{ nullptr };
if (uri.SchemeName() == L"data") {
SetImageSourceForInlineData(str, o, prop);
}
else if (str.ends_with(".svg") || str.ends_with(".svgz")) {
value = xaml::Media::Imaging::SvgImageSource{ uri };
o.SetValue(prop, value);
}
else {
value = xaml::Media::Imaging::BitmapImage{ uri };
o.SetValue(prop, value);
}
}
inline void ReadValue(JSValue const& jsValue, xaml::Media::Geometry& value) noexcept {
const auto v = winrt::to_hstring(jsValue.AsJSString());
value = Markup::XamlBindingHelper::ConvertValue(winrt::xaml_typename<xaml::Media::PathGeometry>(), winrt::box_value(v)).as<xaml::Media::Geometry>();
}
inline void ReadValue(JSValue const& jsValue, Windows::UI::Text::FontWeight& value) noexcept {
value.Weight = jsValue.AsInt16();
}
}
// MapStyle has a bug where it expects the property to be set as an IReference<MapStyle> always, and does not support IReference<uint32_t>
template<typename T, std::enable_if_t<
std::is_same<winrt::Windows::UI::Xaml::Controls::Maps::MapStyle, T>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
auto boxed = v.To<winrt::Windows::UI::Xaml::Controls::Maps::MapStyle>();
o.SetValue(prop, winrt::box_value(boxed));
}
template<typename T, std::enable_if_t<std::is_same<T, winrt::hstring>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
auto b = v.AsString();
o.SetValue(prop, winrt::box_value(winrt::to_hstring(b)));
}
template<typename T, std::enable_if_t<std::is_same<T, winrt::Windows::Foundation::Uri>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
auto cn = winrt::get_class_name(o);
auto uri = Uri{ winrt::to_hstring(v.AsString()) };
o.SetValue(prop, uri);
}
template<typename T, std::enable_if_t<std::is_same<T, winrt::Windows::Foundation::IInspectable>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& context) {
switch (v.Type()) {
case JSValueType::String: return SetPropValue<winrt::hstring>(o, prop, v, context);
case JSValueType::Boolean: return SetPropValue<bool>(o, prop, v, context);
case JSValueType::Double: return SetPropValue<double>(o, prop, v, context);
case JSValueType::Int64: return SetPropValue<int64_t>(o, prop, v, context);
case JSValueType::Object: {
const auto& obj = v.AsObject();
if (obj.find("string") != obj.cend()) {
const auto& value = obj["string"];
return SetPropValue<winrt::Windows::Foundation::IInspectable>(o, prop, value, context);
}
}
}
}
struct PropInfo {
stringKey propName;
using asType_t = winrt::Windows::Foundation::IInspectable(__cdecl*) (const winrt::Windows::Foundation::IInspectable&);
asType_t asType;
using xamlPropertyGetter_t = xaml::DependencyProperty(*)();
xamlPropertyGetter_t xamlPropertyGetter;
using xamlPropertySetter_t = void (*) (const xaml::DependencyObject&, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue&, const winrt::Microsoft::ReactNative::IReactContext& reactContext);
xamlPropertySetter_t xamlPropertySetter;
ViewManagerPropertyType jsType;
void ClearValue(const xaml::DependencyObject& o) const {
o.ClearValue(xamlPropertyGetter());
}
void SetValue(const xaml::DependencyObject& o, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& context) const {
auto dp = xamlPropertyGetter ? xamlPropertyGetter() : nullptr;
if (v.IsNull()) {
if (dp) {
o.ClearValue(dp);
}
}
else {
xamlPropertySetter(o, dp, v, context);
}
}
};
template<typename T>
T Unwrap(const winrt::Windows::Foundation::IInspectable& i) {
if (auto wrapper = i.try_as<winrt::ReactNativeXaml::Wrapper>()) {
return wrapper.WrappedObject().try_as<T>();
}
return nullptr;
}
extern ConstantProviderDelegate GetEvents;
struct AttachedEventInfo {
std::string name;
winrt::event_token token;
};
struct WrapperInfo {
winrt::Windows::Foundation::IInspectable wrappedObject;
std::vector<AttachedEventInfo> events;
};
struct XamlMetadata;
struct EventAttachInfo {
winrt::Microsoft::ReactNative::IReactContext context{ nullptr };
winrt::Windows::Foundation::IInspectable obj{ nullptr };
std::string jsEventName;
const XamlMetadata& xamlMetadata;
};
struct EventInfo {
const char* const name;
using attachHandlers_t = winrt::event_token(*)(const EventAttachInfo&, bool isWrapped, winrt::event_token);
attachHandlers_t attachHandler;
static const EventInfo xamlEventMap[];
};
struct XamlObject;
struct XamlMetadata : std::enable_shared_from_this<XamlMetadata> {
XamlMetadata() = default;
winrt::Windows::Foundation::IInspectable Create(const std::string& typeName, const winrt::Microsoft::ReactNative::IReactContext& context);
void SetupEventDispatcher(const winrt::Microsoft::ReactNative::IReactContext& context);
const PropInfo* GetProp(const std::string& propertyName, const winrt::Windows::Foundation::IInspectable& obj) const;
const EventInfo* AttachEvent(const winrt::Microsoft::ReactNative::IReactContext& context, const std::string& propertyName, const winrt::Windows::Foundation::IInspectable& obj, bool attaching);
void DispatchCommand(FrameworkElement const& view, winrt::hstring const& commandId, const winrt::Microsoft::ReactNative::JSValueArray& args) const noexcept;
void PopulateNativeProps(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const;
void PopulateNativeEvents(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const;
void PopulateNativeProps(std::vector<std::string>& names, const winrt::Windows::Foundation::IInspectable& obj) const;
void PopulateCommands(const winrt::Windows::Foundation::Collections::IVector<winrt::hstring>& commands) const;
void JsiDispatchEvent(facebook::jsi::Runtime& rt, int64_t viewTag, std::string&& eventName, std::shared_ptr<facebook::jsi::Object>& eventData) const noexcept;
std::optional<facebook::jsi::Function> m_callFunctionReturnFlushedQueue;
winrt::Microsoft::ReactNative::IReactDispatcher UIDispatcher() const { return m_reactContext.UIDispatcher(); }
xaml::DependencyObject ElementFromTag(int64_t tag) const { return winrt::Microsoft::ReactNative::XamlUIService::FromContext(m_reactContext).ElementFromReactTag(tag); }
FrameworkElement GetFlyoutTarget(winrt::Windows::Foundation::IInspectable wrapper) const;
private:
winrt::Windows::Foundation::IInspectable Create(const std::string_view& typeName) const;
static const PropInfo* FindFirstMatch(const stringKey& key, const winrt::Windows::Foundation::IInspectable& obj, const PropInfo* map, size_t size);
winrt::Microsoft::ReactNative::IReactContext m_reactContext;
std::map<xaml::FrameworkElement, WrapperInfo> wrapperToWrapped;
};
xaml::DependencyProperty GetPriorityProperty();
#pragma once
#include <pch.h>
#include <functional>
#include <string>
#include <JSValue.h>
#include <JSValueReader.h>
#include <JSValueXaml_local.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.UI.Xaml.Controls.Maps.h>
#include <winrt/Windows.Media.Playback.h>
#include <winrt/Windows.Media.Core.h>
#include <UI.Xaml.Media.Imaging.h>
#include <UI.Xaml.Media.h>
#include "Crc32Str.h"
#include <JSI/JsiApiContext.h>
#include "XamlObject.h"
#include <Wrapper.h>
using namespace xaml;
using namespace xaml::Controls;
using namespace winrt::Microsoft::ReactNative;
namespace winrt::Microsoft::ReactNative {
inline void ReadValue(JSValue const& jsValue, xaml::Style& value) noexcept {
auto key = winrt::to_hstring(jsValue.AsJSString());
value = Application::Current().Resources().Lookup(winrt::box_value(key)).as<Style>();
}
inline void ReadValue(JSValue const& jsValue, xaml::Media::SolidColorBrush& value) noexcept {
auto color = XamlHelper::ColorFrom([&jsValue](IJSValueWriter const& writer) noexcept { jsValue.WriteTo(writer); });
value = xaml::Media::SolidColorBrush(color);
}
inline void ReadValue(JSValue const& jsValue, xaml::Media::FontFamily& value) noexcept {
auto str = winrt::to_hstring(jsValue.AsString());
value = xaml::Media::FontFamily(str);
}
inline void ReadValue(JSValue const& jsValue, Windows::Media::Playback::IMediaPlaybackSource& value) noexcept {
const auto uri = Uri{ winrt::to_hstring(jsValue.AsString()) };
auto source = Windows::Media::Core::MediaSource::CreateFromUri(uri);
value = source;
}
winrt::fire_and_forget SetImageSourceForInlineData(std::string str, xaml::DependencyObject o, xaml::DependencyProperty dp);
enum class XamlPropType {
Boolean,
Int,
Double,
String,
Object,
Enum,
};
template <typename T> bool IsType(const winrt::Windows::Foundation::IInspectable& i) { return i.try_as<T>() != nullptr; }
template<typename T, std::enable_if_t<std::is_enum<T>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
auto valueEnum = MakeEnum<T>(v.AsInt32());
o.SetValue(prop, valueEnum);
}
template<typename T, std::enable_if_t<
!std::is_enum<T>::value &&
!std::is_same<winrt::hstring, T>::value &&
!std::is_same<winrt::Windows::Foundation::IInspectable, T>::value &&
!std::is_same<winrt::Windows::Foundation::Uri, T>::value &&
!std::is_same<xaml::Media::ImageSource, T>::value
, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
auto b = v.To<T>();
o.SetValue(prop, winrt::box_value(b));
}
template<typename T, std::enable_if_t<
std::is_same<xaml::Media::ImageSource, T>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
const auto str = v.AsString();
const auto uri = Uri{ winrt::to_hstring(str) };
xaml::Media::ImageSource value{ nullptr };
if (uri.SchemeName() == L"data") {
SetImageSourceForInlineData(str, o, prop);
}
else if (str.ends_with(".svg") || str.ends_with(".svgz")) {
value = xaml::Media::Imaging::SvgImageSource{ uri };
o.SetValue(prop, value);
}
else {
value = xaml::Media::Imaging::BitmapImage{ uri };
o.SetValue(prop, value);
}
}
inline void ReadValue(JSValue const& jsValue, xaml::Media::Geometry& value) noexcept {
const auto v = winrt::to_hstring(jsValue.AsJSString());
value = Markup::XamlBindingHelper::ConvertValue(winrt::xaml_typename<xaml::Media::PathGeometry>(), winrt::box_value(v)).as<xaml::Media::Geometry>();
}
inline void ReadValue(JSValue const& jsValue, Windows::UI::Text::FontWeight& value) noexcept {
value.Weight = jsValue.AsInt16();
}
}
// MapStyle has a bug where it expects the property to be set as an IReference<MapStyle> always, and does not support IReference<uint32_t>
template<typename T, std::enable_if_t<
std::is_same<winrt::Windows::UI::Xaml::Controls::Maps::MapStyle, T>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
auto boxed = v.To<winrt::Windows::UI::Xaml::Controls::Maps::MapStyle>();
o.SetValue(prop, winrt::box_value(boxed));
}
template<typename T, std::enable_if_t<std::is_same<T, winrt::hstring>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
auto b = v.AsString();
o.SetValue(prop, winrt::box_value(winrt::to_hstring(b)));
}
template<typename T, std::enable_if_t<std::is_same<T, winrt::Windows::Foundation::Uri>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext&) {
auto cn = winrt::get_class_name(o);
auto uri = Uri{ winrt::to_hstring(v.AsString()) };
o.SetValue(prop, uri);
}
template<typename T, std::enable_if_t<std::is_same<T, winrt::Windows::Foundation::IInspectable>::value, int> = 0>
void SetPropValue(const xaml::DependencyObject& o, const xaml::DependencyProperty& prop, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& context) {
switch (v.Type()) {
case JSValueType::String: return SetPropValue<winrt::hstring>(o, prop, v, context);
case JSValueType::Boolean: return SetPropValue<bool>(o, prop, v, context);
case JSValueType::Double: return SetPropValue<double>(o, prop, v, context);
case JSValueType::Int64: return SetPropValue<int64_t>(o, prop, v, context);
case JSValueType::Object: {
const auto& obj = v.AsObject();
if (obj.find("string") != obj.cend()) {
const auto& value = obj["string"];
return SetPropValue<winrt::Windows::Foundation::IInspectable>(o, prop, value, context);
}
}
}
}
struct PropInfo {
stringKey propName;
using asType_t = winrt::Windows::Foundation::IInspectable(__cdecl*) (const winrt::Windows::Foundation::IInspectable&);
asType_t asType;
using xamlPropertyGetter_t = xaml::DependencyProperty(*)();
xamlPropertyGetter_t xamlPropertyGetter;
using xamlPropertySetter_t = void (*) (const xaml::DependencyObject&, const xaml::DependencyProperty&, const winrt::Microsoft::ReactNative::JSValue&, const winrt::Microsoft::ReactNative::IReactContext& reactContext);
xamlPropertySetter_t xamlPropertySetter;
ViewManagerPropertyType jsType;
void ClearValue(const xaml::DependencyObject& o) const {
o.ClearValue(xamlPropertyGetter());
}
void SetValue(const xaml::DependencyObject& o, const winrt::Microsoft::ReactNative::JSValue& v, const winrt::Microsoft::ReactNative::IReactContext& context) const {
auto dp = xamlPropertyGetter ? xamlPropertyGetter() : nullptr;
if (v.IsNull()) {
if (dp) {
o.ClearValue(dp);
}
}
else {
xamlPropertySetter(o, dp, v, context);
}
}
};
template<typename T>
T Unwrap(const winrt::Windows::Foundation::IInspectable& i) {
if (auto wrapper = i.try_as<winrt::ReactNativeXaml::Wrapper>()) {
return wrapper.WrappedObject().try_as<T>();
}
return nullptr;
}
extern ConstantProviderDelegate GetEvents;
struct AttachedEventInfo {
std::string name;
winrt::event_token token;
};
struct WrapperInfo {
winrt::Windows::Foundation::IInspectable wrappedObject;
std::vector<AttachedEventInfo> events;
};
struct XamlMetadata;
struct EventAttachInfo {
winrt::Microsoft::ReactNative::IReactContext context{ nullptr };
winrt::Windows::Foundation::IInspectable obj{ nullptr };
std::string jsEventName;
const XamlMetadata& xamlMetadata;
};
struct EventInfo {
const char* const name;
using attachHandlers_t = winrt::event_token(*)(const EventAttachInfo&, bool isWrapped, winrt::event_token);
attachHandlers_t attachHandler;
static const EventInfo xamlEventMap[];
};
struct XamlObject;
struct XamlMetadata : std::enable_shared_from_this<XamlMetadata> {
XamlMetadata() = default;
winrt::Windows::Foundation::IInspectable Create(const std::string& typeName, const winrt::Microsoft::ReactNative::IReactContext& context);
void SetupEventDispatcher(const winrt::Microsoft::ReactNative::IReactContext& context);
const PropInfo* GetProp(const std::string& propertyName, const winrt::Windows::Foundation::IInspectable& obj) const;
const EventInfo* AttachEvent(const winrt::Microsoft::ReactNative::IReactContext& context, const std::string& propertyName, const winrt::Windows::Foundation::IInspectable& obj, bool attaching);
void DispatchCommand(FrameworkElement const& view, winrt::hstring const& commandId, const winrt::Microsoft::ReactNative::JSValueArray& args) const noexcept;
void PopulateNativeProps(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const;
void PopulateNativeEvents(winrt::Windows::Foundation::Collections::IMap<winrt::hstring, ViewManagerPropertyType>& nativeProps) const;
void PopulateNativeProps(std::vector<std::string>& names, const winrt::Windows::Foundation::IInspectable& obj) const;
void PopulateCommands(const winrt::Windows::Foundation::Collections::IVector<winrt::hstring>& commands) const;
void JsiDispatchEvent(facebook::jsi::Runtime& rt, int64_t viewTag, std::string&& eventName, std::shared_ptr<facebook::jsi::Object>& eventData) const noexcept;
std::optional<facebook::jsi::Function> m_callFunctionReturnFlushedQueue;
winrt::Microsoft::ReactNative::IReactDispatcher UIDispatcher() const { return m_reactContext.UIDispatcher(); }
xaml::DependencyObject ElementFromTag(int64_t tag) const { return winrt::Microsoft::ReactNative::XamlUIService::FromContext(m_reactContext).ElementFromReactTag(tag); }
FrameworkElement GetFlyoutTarget(winrt::Windows::Foundation::IInspectable wrapper) const;
private:
winrt::Windows::Foundation::IInspectable Create(const std::string_view& typeName) const;
static const PropInfo* FindFirstMatch(const stringKey& key, const winrt::Windows::Foundation::IInspectable& obj, const PropInfo* map, size_t size);
winrt::Microsoft::ReactNative::IReactContext m_reactContext;
std::map<xaml::FrameworkElement, WrapperInfo> wrapperToWrapped;
};
xaml::DependencyProperty GetPriorityProperty();

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

@ -1,32 +1,32 @@
#pragma once
#include "pch.h"
#include "JSI/JsiApiContext.h"
#include "XamlMetadata.h"
#include <winrt/Windows.Foundation.Collections.h>
#include <vector>
struct XamlMetadata;
struct XamlObject : std::enable_shared_from_this<XamlObject>, facebook::jsi::HostObject {
facebook::jsi::Value get(facebook::jsi::Runtime& rt, const facebook::jsi::PropNameID& nameId) noexcept override;
void set(facebook::jsi::Runtime& rt, const facebook::jsi::PropNameID& name, const facebook::jsi::Value& value) noexcept override;
std::vector<facebook::jsi::PropNameID> getPropertyNames(facebook::jsi::Runtime& rt) noexcept override;
XamlObject() = default;
XamlObject(winrt::Windows::Foundation::IInspectable obj, std::shared_ptr<const XamlMetadata> metadata) : m_obj(obj), m_metadata(metadata) {}
XamlObject(const XamlObject&) = default;
template<typename T = winrt::Windows::Foundation::IInspectable>
T try_as() const { return m_obj.try_as<T>(); }
facebook::jsi::Value IInspectableToValue(facebook::jsi::Runtime& rt, const winrt::Windows::Foundation::IInspectable& inspectable) const;
template <typename TLambda, std::enable_if_t<!std::is_void<std::invoke_result_t<TLambda>>::value, int> = 0>
auto RunOnUIThread(const TLambda& code) const;
template <typename TLambda, std::enable_if_t<std::is_void<std::invoke_result_t<TLambda>>::value, int> = 0>
void RunOnUIThread(const TLambda& code) const;
std::shared_ptr<const XamlMetadata> m_metadata;
private:
winrt::Windows::Foundation::IInspectable m_obj;
#pragma once
#include "pch.h"
#include "JSI/JsiApiContext.h"
#include "XamlMetadata.h"
#include <winrt/Windows.Foundation.Collections.h>
#include <vector>
struct XamlMetadata;
struct XamlObject : std::enable_shared_from_this<XamlObject>, facebook::jsi::HostObject {
facebook::jsi::Value get(facebook::jsi::Runtime& rt, const facebook::jsi::PropNameID& nameId) noexcept override;
void set(facebook::jsi::Runtime& rt, const facebook::jsi::PropNameID& name, const facebook::jsi::Value& value) noexcept override;
std::vector<facebook::jsi::PropNameID> getPropertyNames(facebook::jsi::Runtime& rt) noexcept override;
XamlObject() = default;
XamlObject(winrt::Windows::Foundation::IInspectable obj, std::shared_ptr<const XamlMetadata> metadata) : m_obj(obj), m_metadata(metadata) {}
XamlObject(const XamlObject&) = default;
template<typename T = winrt::Windows::Foundation::IInspectable>
T try_as() const { return m_obj.try_as<T>(); }
facebook::jsi::Value IInspectableToValue(facebook::jsi::Runtime& rt, const winrt::Windows::Foundation::IInspectable& inspectable) const;
template <typename TLambda, std::enable_if_t<!std::is_void<std::invoke_result_t<TLambda>>::value, int> = 0>
auto RunOnUIThread(const TLambda& code) const;
template <typename TLambda, std::enable_if_t<std::is_void<std::invoke_result_t<TLambda>>::value, int> = 0>
void RunOnUIThread(const TLambda& code) const;
std::shared_ptr<const XamlMetadata> m_metadata;
private:
winrt::Windows::Foundation::IInspectable m_obj;
};

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

@ -1,79 +1,79 @@
#pragma once
#include "pch.h"
#include "CppWinRTIncludes.h"
#include "winrt/Microsoft.ReactNative.h"
#include "XamlMetadata.h"
#include "JSI/JsiApiContext.h"
namespace winrt::ReactNativeXaml {
struct XamlViewManager :
winrt::implements<
XamlViewManager,
winrt::Microsoft::ReactNative::IViewManager,
winrt::Microsoft::ReactNative::IViewManagerWithNativeProperties,
winrt::Microsoft::ReactNative::IViewManagerWithCommands,
winrt::Microsoft::ReactNative::IViewManagerWithExportedEventTypeConstants,
winrt::Microsoft::ReactNative::IViewManagerWithReactContext,
winrt::Microsoft::ReactNative::IViewManagerWithChildren,
winrt::Microsoft::ReactNative::IViewManagerCreateWithProperties,
winrt::Microsoft::ReactNative::IViewManagerRequiresNativeLayout
> {
public:
XamlViewManager() = default;
// IViewManager
winrt::hstring Name() noexcept;
xaml::FrameworkElement CreateView() noexcept;
// IViewManagerCreateWithProperties
winrt::IInspectable CreateViewWithProperties(winrt::Microsoft::ReactNative::IJSValueReader const& propertyMapReader) noexcept;
// IViewManagerWithNativeProperties
winrt::Windows::Foundation::Collections::
IMapView<winrt::hstring, winrt::Microsoft::ReactNative::ViewManagerPropertyType>
NativeProps() noexcept;
void UpdateProperties(
winrt::Windows::UI::Xaml::FrameworkElement const& view,
winrt::Microsoft::ReactNative::IJSValueReader const& propertyMapReader) noexcept;
// IViewManagerWithCommands
winrt::Windows::Foundation::Collections::IVectorView<winrt::hstring> Commands() noexcept;
void DispatchCommand(
winrt::Windows::UI::Xaml::FrameworkElement const& view,
winrt::hstring const& commandId,
winrt::Microsoft::ReactNative::IJSValueReader const& commandArgsReader) noexcept;
winrt::Microsoft::ReactNative::ConstantProviderDelegate ExportedCustomBubblingEventTypeConstants() noexcept;
winrt::Microsoft::ReactNative::ConstantProviderDelegate ExportedCustomDirectEventTypeConstants() noexcept;
// IViewManagerWithReactContext
winrt::Microsoft::ReactNative::IReactContext ReactContext() noexcept;
void ReactContext(winrt::Microsoft::ReactNative::IReactContext reactContext) noexcept;
// IViewManagerRequiresNativeLayout
bool RequiresNativeLayout() noexcept;
// IViewManagerWithChildren
void AddView(xaml::FrameworkElement parent, xaml::UIElement child, int64_t index);
void RemoveAllChildren(xaml::FrameworkElement parent);
void RemoveChildAt(xaml::FrameworkElement parent, int64_t index);
void ReplaceChild(xaml::FrameworkElement parent, xaml::UIElement oldChild, xaml::UIElement newChild);
static winrt::Microsoft::ReactNative::ReactPropertyId<IViewManager> XamlViewManagerProperty() {
return { L"ReactNativeXaml", L"ViewManager" };
}
const std::shared_ptr<XamlMetadata>& Metadata() const { return m_xamlMetadata; }
private:
winrt::Microsoft::ReactNative::IReactContext m_reactContext{ nullptr };
std::shared_ptr<XamlMetadata> m_xamlMetadata;
};
}
#pragma once
#include "pch.h"
#include "CppWinRTIncludes.h"
#include "winrt/Microsoft.ReactNative.h"
#include "XamlMetadata.h"
#include "JSI/JsiApiContext.h"
namespace winrt::ReactNativeXaml {
struct XamlViewManager :
winrt::implements<
XamlViewManager,
winrt::Microsoft::ReactNative::IViewManager,
winrt::Microsoft::ReactNative::IViewManagerWithNativeProperties,
winrt::Microsoft::ReactNative::IViewManagerWithCommands,
winrt::Microsoft::ReactNative::IViewManagerWithExportedEventTypeConstants,
winrt::Microsoft::ReactNative::IViewManagerWithReactContext,
winrt::Microsoft::ReactNative::IViewManagerWithChildren,
winrt::Microsoft::ReactNative::IViewManagerCreateWithProperties,
winrt::Microsoft::ReactNative::IViewManagerRequiresNativeLayout
> {
public:
XamlViewManager() = default;
// IViewManager
winrt::hstring Name() noexcept;
xaml::FrameworkElement CreateView() noexcept;
// IViewManagerCreateWithProperties
winrt::IInspectable CreateViewWithProperties(winrt::Microsoft::ReactNative::IJSValueReader const& propertyMapReader) noexcept;
// IViewManagerWithNativeProperties
winrt::Windows::Foundation::Collections::
IMapView<winrt::hstring, winrt::Microsoft::ReactNative::ViewManagerPropertyType>
NativeProps() noexcept;
void UpdateProperties(
winrt::Windows::UI::Xaml::FrameworkElement const& view,
winrt::Microsoft::ReactNative::IJSValueReader const& propertyMapReader) noexcept;
// IViewManagerWithCommands
winrt::Windows::Foundation::Collections::IVectorView<winrt::hstring> Commands() noexcept;
void DispatchCommand(
winrt::Windows::UI::Xaml::FrameworkElement const& view,
winrt::hstring const& commandId,
winrt::Microsoft::ReactNative::IJSValueReader const& commandArgsReader) noexcept;
winrt::Microsoft::ReactNative::ConstantProviderDelegate ExportedCustomBubblingEventTypeConstants() noexcept;
winrt::Microsoft::ReactNative::ConstantProviderDelegate ExportedCustomDirectEventTypeConstants() noexcept;
// IViewManagerWithReactContext
winrt::Microsoft::ReactNative::IReactContext ReactContext() noexcept;
void ReactContext(winrt::Microsoft::ReactNative::IReactContext reactContext) noexcept;
// IViewManagerRequiresNativeLayout
bool RequiresNativeLayout() noexcept;
// IViewManagerWithChildren
void AddView(xaml::FrameworkElement parent, xaml::UIElement child, int64_t index);
void RemoveAllChildren(xaml::FrameworkElement parent);
void RemoveChildAt(xaml::FrameworkElement parent, int64_t index);
void ReplaceChild(xaml::FrameworkElement parent, xaml::UIElement oldChild, xaml::UIElement newChild);
static winrt::Microsoft::ReactNative::ReactPropertyId<IViewManager> XamlViewManagerProperty() {
return { L"ReactNativeXaml", L"ViewManager" };
}
const std::shared_ptr<XamlMetadata>& Metadata() const { return m_xamlMetadata; }
private:
winrt::Microsoft::ReactNative::IReactContext m_reactContext{ nullptr };
std::shared_ptr<XamlMetadata> m_xamlMetadata;
};
}

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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CDebug" version="0.0.3" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.210309.3" targetFramework="native" />
<package id="Microsoft.UI.Xaml" version="2.6.0" targetFramework="native" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CDebug" version="0.0.3" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.210309.3" targetFramework="native" />
<package id="Microsoft.UI.Xaml" version="2.6.0" targetFramework="native" />
</packages>

15324
yarn.lock

Разница между файлами не показана из-за своего большого размера Загрузить разницу