Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend PayloadReader APIs to meet the WinForms requirements #11341

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Winforms.sln
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TrimTestBinaryDeserializati
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BinaryFormatTests", "src\System.Private.Windows.Core\tests\BinaryFormatTests\BinaryFormatTests.csproj", "{57EC5288-9513-46CF-8FB7-626199690D90}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.Serialization.BinaryFormat", "src\System.Runtime.Serialization.BinaryFormat\System.Runtime.Serialization.BinaryFormat.csproj", "{DC3DD357-7FB4-4384-92DC-5D34864D010B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -981,6 +983,22 @@ Global
{57EC5288-9513-46CF-8FB7-626199690D90}.Release|x64.Build.0 = Release|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Release|x86.ActiveCfg = Release|Any CPU
{57EC5288-9513-46CF-8FB7-626199690D90}.Release|x86.Build.0 = Release|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Debug|arm64.ActiveCfg = Debug|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Debug|arm64.Build.0 = Debug|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Debug|x64.ActiveCfg = Debug|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Debug|x64.Build.0 = Debug|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Debug|x86.ActiveCfg = Debug|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Debug|x86.Build.0 = Debug|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Release|Any CPU.Build.0 = Release|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Release|arm64.ActiveCfg = Release|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Release|arm64.Build.0 = Release|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Release|x64.ActiveCfg = Release|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Release|x64.Build.0 = Release|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Release|x86.ActiveCfg = Release|Any CPU
{DC3DD357-7FB4-4384-92DC-5D34864D010B}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1044,6 +1062,7 @@ Global
{55F3174F-C1FE-4C8F-AF71-2512630088F8} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC}
{CFBCC732-C988-4FE7-A21B-98A142365374} = {680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A}
{57EC5288-9513-46CF-8FB7-626199690D90} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC}
{DC3DD357-7FB4-4384-92DC-5D34864D010B} = {77FEDB47-F7F6-490D-AF7C-ABB4A9E0B9D7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7B1B0433-F612-4E5A-BE7E-FCF5B9F6E136}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWin32" Version="$(MicrosoftWindowsCsWin32PackageVersion)" PrivateAssets="all" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="$(SystemRuntimeCompilerServicesUnsafePackageVersion)" />
<PackageReference Include="System.Reflection.Metadata" Version="9.0.0-preview.4.24225.2" />
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\System.Runtime.Serialization.BinaryFormat\System.Runtime.Serialization.BinaryFormat.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.Serialization.BinaryFormat;

namespace System.Windows.Forms.BinaryFormat;

internal sealed partial class BinaryFormattedObject
Expand All @@ -11,7 +13,7 @@ internal sealed partial class BinaryFormattedObject
internal interface IParseState
{
BinaryReader Reader { get; }
RecordMap RecordMap { get; }
IReadOnlyDictionary<int, SerializationRecord> RecordMap { get; }
Options Options { get; }
ITypeResolver TypeResolver { get; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Reflection.Metadata;

namespace System.Windows.Forms.BinaryFormat;

internal sealed partial class BinaryFormattedObject
Expand All @@ -13,9 +15,9 @@ internal interface ITypeResolver
/// <summary>
/// Resolves the given type name against the specified library.
/// </summary>
/// <param name="libraryId">The library id, or <see cref="Id.Null"/> for the "system" assembly.</param>
/// <param name="libraryName">The library id, or <see cref="Id.Null"/> for the "system" assembly.</param>
[RequiresUnreferencedCode("Calls System.Reflection.Assembly.GetType(String)")]
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
Type GetType(string typeName, Id libraryId);
Type GetType(TypeName typeName, AssemblyNameInfo libraryName);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.Serialization.BinaryFormat;

namespace System.Windows.Forms.BinaryFormat;

internal sealed partial class BinaryFormattedObject
Expand All @@ -19,7 +21,7 @@ public ParseState(BinaryReader reader, BinaryFormattedObject format)
}

public BinaryReader Reader { get; }
public RecordMap RecordMap => _format._recordMap;
public IReadOnlyDictionary<int, SerializationRecord> RecordMap => _format.RecordMap;
public Options Options => _format._options;
public ITypeResolver TypeResolver => _format.TypeResolver;
}
Expand Down
Loading