Skip to content

Commit a751fdf

Browse files
authored
Merge pull request #9507 from dotnet/9.0-p7-backport-nrbf
Backport BinaryFormatter changes to Preview 7
2 parents 60837b4 + 57a01ac commit a751fdf

File tree

71 files changed

+570
-2614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+570
-2614
lines changed

Microsoft.Dotnet.Wpf.sln

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{34B64A4A
247247
EndProject
248248
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnitTests", "UnitTests", "{A48B585E-6AB0-4F8D-8484-77F37CB44437}"
249249
EndProject
250-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFB}") = "System.Xaml.Tests", "src\Microsoft.DotNet.Wpf\tests\UnitTests\System.Xaml.Tests\System.Xaml.Tests.csproj", "{B2F2A89C-55C9-41B1-A645-0948609BD8BE}"
250+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Xaml.Tests", "src\Microsoft.DotNet.Wpf\tests\UnitTests\System.Xaml.Tests\System.Xaml.Tests.csproj", "{B2F2A89C-55C9-41B1-A645-0948609BD8BE}"
251251
EndProject
252252
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PresentationFramework.Fluent", "src\Microsoft.DotNet.Wpf\src\Themes\PresentationFramework.Fluent\PresentationFramework.Fluent.csproj", "{3F2C0E0E-BB13-46D9-8D9A-08256A49ECA9}"
253253
EndProject
254254
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PresentationFramework.Fluent-ref", "src\Microsoft.DotNet.Wpf\src\Themes\PresentationFramework.Fluent\ref\PresentationFramework.Fluent-ref.csproj", "{3C43C553-2C1F-4EB9-8BF8-371D4A42E0FD}"
255255
EndProject
256+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PresentationCore.Tests", "src\Microsoft.DotNet.Wpf\tests\UnitTests\PresentationCore.Tests\PresentationCore.Tests.csproj", "{A4377D3F-6BA1-4994-945C-88667993E4F3}"
257+
EndProject
256258
Global
257259
GlobalSection(SolutionConfigurationPlatforms) = preSolution
258260
Debug|Any CPU = Debug|Any CPU
@@ -1924,28 +1926,22 @@ Global
19241926
{AF9084C3-BF37-4A56-A851-89F3BAE731B3}.Release|x86.ActiveCfg = Release|Win32
19251927
{AF9084C3-BF37-4A56-A851-89F3BAE731B3}.Release|x86.Build.0 = Release|Win32
19261928
{AF9084C3-BF37-4A56-A851-89F3BAE731B3}.Release|x86.Deploy.0 = Release|Win32
1927-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|Any CPU.ActiveCfg = Debug|Win32
1928-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|Any CPU.Build.0 = Debug|Win32
1929-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|Any CPU.Deploy.0 = Debug|Win32
1929+
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1930+
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
19301931
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|ARM64.ActiveCfg = Debug|ARM64
19311932
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|ARM64.Build.0 = Debug|ARM64
19321933
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x64.ActiveCfg = Debug|x64
19331934
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x64.Build.0 = Debug|x64
1934-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x64.Deploy.0 = Debug|x64
19351935
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x86.ActiveCfg = Debug|x86
19361936
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x86.Build.0 = Debug|x86
1937-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x86.Deploy.0 = Debug|x86
1938-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|Any CPU.ActiveCfg = Release|Win32
1939-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|Any CPU.Build.0 = Release|Win32
1940-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|Any CPU.Deploy.0 = Release|Win32
1937+
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
1938+
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|Any CPU.Build.0 = Release|Any CPU
19411939
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|ARM64.ActiveCfg = Release|ARM64
19421940
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|ARM64.Build.0 = Release|ARM64
19431941
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x64.ActiveCfg = Release|x64
19441942
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x64.Build.0 = Release|x64
1945-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x64.Deploy.0 = Release|x64
19461943
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x86.ActiveCfg = Release|x86
19471944
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x86.Build.0 = Release|x86
1948-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x86.Deploy.0 = Release|x86
19491945
{3F2C0E0E-BB13-46D9-8D9A-08256A49ECA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19501946
{3F2C0E0E-BB13-46D9-8D9A-08256A49ECA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
19511947
{3F2C0E0E-BB13-46D9-8D9A-08256A49ECA9}.Debug|ARM64.ActiveCfg = Debug|arm64
@@ -1978,6 +1974,22 @@ Global
19781974
{3C43C553-2C1F-4EB9-8BF8-371D4A42E0FD}.Release|x64.Build.0 = Release|x64
19791975
{3C43C553-2C1F-4EB9-8BF8-371D4A42E0FD}.Release|x86.ActiveCfg = Release|Any CPU
19801976
{3C43C553-2C1F-4EB9-8BF8-371D4A42E0FD}.Release|x86.Build.0 = Release|Any CPU
1977+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1978+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
1979+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|ARM64.ActiveCfg = Debug|ARM64
1980+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|ARM64.Build.0 = Debug|ARM64
1981+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|x64.ActiveCfg = Debug|x64
1982+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|x64.Build.0 = Debug|x64
1983+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|x86.ActiveCfg = Debug|x86
1984+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|x86.Build.0 = Debug|x86
1985+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
1986+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|Any CPU.Build.0 = Release|Any CPU
1987+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|ARM64.ActiveCfg = Release|ARM64
1988+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|ARM64.Build.0 = Release|ARM64
1989+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|x64.ActiveCfg = Release|x64
1990+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|x64.Build.0 = Release|x64
1991+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|x86.ActiveCfg = Release|x86
1992+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|x86.Build.0 = Release|x86
19811993
EndGlobalSection
19821994
GlobalSection(SolutionProperties) = preSolution
19831995
HideSolutionNode = FALSE
@@ -2100,6 +2112,7 @@ Global
21002112
{B2F2A89C-55C9-41B1-A645-0948609BD8BE} = {A48B585E-6AB0-4F8D-8484-77F37CB44437}
21012113
{3F2C0E0E-BB13-46D9-8D9A-08256A49ECA9} = {5ACFB055-649D-4A01-98C2-B0BFE7E543D6}
21022114
{3C43C553-2C1F-4EB9-8BF8-371D4A42E0FD} = {60F4058B-D35B-42D2-B276-D44B3AC579BD}
2115+
{A4377D3F-6BA1-4994-945C-88667993E4F3} = {A48B585E-6AB0-4F8D-8484-77F37CB44437}
21032116
EndGlobalSection
21042117
GlobalSection(ExtensibilityGlobals) = postSolution
21052118
SolutionGuid = {B4340004-DAC0-497D-B69D-CFA7CD93F567}

eng/Version.Details.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@
9595
<Uri>https://github.com/dotnet/runtime</Uri>
9696
<Sha>bdcf3ef75e11d22e4973bf37f2d5b660b73aa266</Sha>
9797
</Dependency>
98+
<Dependency Name="System.Formats.Nrbf" Version="9.0.0-preview.7.24376.15" CoherentParentDependency="Microsoft.Private.Winforms">
99+
<Uri>https://github.com/dotnet/runtime</Uri>
100+
<Sha>bdcf3ef75e11d22e4973bf37f2d5b660b73aa266</Sha>
101+
</Dependency>
98102
<Dependency Name="System.IO.Packaging" Version="9.0.0-preview.7.24376.15" CoherentParentDependency="Microsoft.Private.Winforms">
99103
<Uri>https://github.com/dotnet/runtime</Uri>
100104
<Sha>bdcf3ef75e11d22e4973bf37f2d5b660b73aa266</Sha>

eng/Versions.props

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<SystemDiagnosticsEventLogPackageVersion>9.0.0-preview.7.24376.15</SystemDiagnosticsEventLogPackageVersion>
3535
<SystemDrawingCommonVersion>9.0.0-preview.7.24379.1</SystemDrawingCommonVersion>
3636
<SystemDirectoryServicesVersion>9.0.0-preview.7.24376.15</SystemDirectoryServicesVersion>
37+
<SystemFormatsNrbfVersion>9.0.0-preview.7.24376.15</SystemFormatsNrbfVersion>
3738
<SystemIOPackagingVersion>9.0.0-preview.7.24376.15</SystemIOPackagingVersion>
3839
<SystemReflectionMetadataLoadContextVersion>9.0.0-preview.7.24376.15</SystemReflectionMetadataLoadContextVersion>
3940
<SystemReflectionTypeExtensionsPackageVersion>4.6.0-preview4.19176.11</SystemReflectionTypeExtensionsPackageVersion>
@@ -66,14 +67,14 @@
6667
<PropertyGroup>
6768
<MicrosoftBuildFrameworkPackageVersion>15.9.20</MicrosoftBuildFrameworkPackageVersion>
6869
<MicrosoftBuildUtilitiesCorePackageVersion>15.9.20</MicrosoftBuildUtilitiesCorePackageVersion>
69-
<!--
70-
Also in global.json
71-
Used in Wpf.Cpp.PrivateTools.props/targets
70+
<!--
71+
Also in global.json
72+
Used in Wpf.Cpp.PrivateTools.props/targets
7273
<MsvcurtC1xxVersion>0.0.1.2</MsvcurtC1xxVersion>
7374
-->
7475
<!--
7576
This is the version of the test infrastructure package is compiled against. This should be
76-
removed as part of https://github.com/dotnet/wpf/issues/816
77+
removed as part of https://github.com/dotnet/wpf/issues/816
7778
-->
7879
<MicrosoftDotNetWpfTestPackageVersion>1.0.0-beta.19263.1</MicrosoftDotNetWpfTestPackageVersion>
7980
<!-- These versions are specified in global.json -->
@@ -86,10 +87,10 @@
8687
</PropertyGroup>
8788
<!-- XUnit-related (not extensions) -->
8889
<PropertyGroup>
89-
<XUnitVersion>2.4.0</XUnitVersion>
90+
<XUnitVersion>2.9.0</XUnitVersion>
9091
<XUnitAssertVersion>$(XUnitVersion)</XUnitAssertVersion>
9192
<XUnitRunnerConsoleVersion>$(XUnitVersion)</XUnitRunnerConsoleVersion>
92-
<XUnitRunnerVisualStudioVersion>2.4.0</XUnitRunnerVisualStudioVersion>
93+
<XUnitRunnerVisualStudioVersion>2.8.1</XUnitRunnerVisualStudioVersion>
9394
<XUnitExtensibilityExecutionVersion>$(XUnitVersion)</XUnitExtensibilityExecutionVersion>
9495
<XUnitStaFactPackageVersion>1.2.46-alpha</XUnitStaFactPackageVersion>
9596
</PropertyGroup>

eng/WpfArcadeSdk/tools/TestProjects.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
<PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryPackageVersion)" />
3030
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerPackageVersion)" CopyLocal="true" />
3131
<PackageReference Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogPackageVersion)" CopyLocal="true" />
32-
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="$(SystemRuntimeSerializationFormattersPackageVersion)" CopyLocal="true" />
3332
<PackageReference Include="System.Security.Cryptography.Xml" Version="$(SystemSecurityCryptographyXmlPackageVersion)" CopyLocal="true" />
3433
<PackageReference Include="System.Windows.Extensions" Version="$(SystemWindowsExtensionsPackageVersion)" CopyLocal="true" />
3534

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"tools": {
3-
"dotnet": "9.0.100-preview.5.24307.3",
3+
"dotnet": "9.0.100-preview.6.24328.19",
44
"runtimes": {
55
"dotnet": [
66
"2.1.7",
@@ -16,7 +16,7 @@
1616
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24368.9"
1717
},
1818
"sdk": {
19-
"version": "9.0.100-preview.5.24307.3"
19+
"version": "9.0.100-preview.6.24328.19"
2020
},
2121
"native-tools": {
2222
"strawberry-perl": "5.38.0.1",

src/Microsoft.DotNet.Wpf/src/PresentationCore/OtherAssemblyAttrs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[assembly:InternalsVisibleTo(BuildInfo.PresentationFrameworkSystemDrawing)]
1919
[assembly:InternalsVisibleTo(BuildInfo.SystemWindowsControlsRibbon)]
2020
[assembly:InternalsVisibleTo(BuildInfo.WindowsFormsIntegration)]
21-
[assembly:InternalsVisibleTo("PresentationCore.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
21+
[assembly:InternalsVisibleTo($"PresentationCore.Tests, PublicKey={BuildInfo.WCP_PUBLIC_KEY_STRING}")]
2222
[assembly: TypeForwardedTo(typeof(System.Windows.Markup.IUriContext))]
2323
[assembly: TypeForwardedTo(typeof(System.Windows.Media.TextFormattingMode))]
2424
[assembly: TypeForwardedTo(typeof(System.Windows.Input.ICommand))]

src/Microsoft.DotNet.Wpf/src/PresentationCore/PresentationCore.csproj

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -338,19 +338,15 @@
338338
<Compile Include="System\Windows\BinaryFormat\BinaryFormatWriterScope.cs" />
339339
<Compile Include="System\Windows\BinaryFormat\ExceptionExtensions.cs" />
340340
<Compile Include="System\Windows\BinaryFormat\BinaryObjectString.cs" />
341-
<Compile Include="System\Windows\BinaryFormat\IBinaryFormatParseable.cs" />
342341
<Compile Include="System\Windows\BinaryFormat\IBinaryWriteable.cs" />
343342
<Compile Include="System\Windows\BinaryFormat\MemberTypeInfo.cs" />
344343
<Compile Include="System\Windows\BinaryFormat\Id.cs" />
345344
<Compile Include="System\Windows\BinaryFormat\IRecord.cs" />
346-
<Compile Include="System\Windows\BinaryFormat\RecordMap.cs" />
347345
<Compile Include="System\Windows\BinaryFormat\RecordType.cs" />
348-
<Compile Include="System\Windows\BinaryFormat\NullableAttributes.cs" />
349346
<Compile Include="System\Windows\BinaryFormat\ListConverterHelper.cs" />
350347
<Compile Include="System\Windows\BinaryFormat\FormatterConverterStub.cs" />
351348
<Compile Include="System\Windows\BinaryFormat\SerializationExtensions.cs" />
352-
<Compile Include="System\Windows\BinaryFormat\BinaryFormattedObject.cs" />
353-
<Compile Include="System\Windows\BinaryFormat\BinaryFormattedObjectExtensions.cs" />
349+
<Compile Include="System\Windows\Nrbf\SerializationRecordExtensions.cs" />
354350
<Compile Include="System\Windows\BinaryFormat\MessageEnd.cs" />
355351
<Compile Include="System\Windows\BinaryFormat\Record.cs" />
356352
<Compile Include="System\Windows\BinaryFormat\BinaryType.cs" />
@@ -366,19 +362,14 @@
366362
<Compile Include="System\Windows\BinaryFormat\BinaryLibrary.cs" />
367363
<Compile Include="System\Windows\BinaryFormat\MemberReference.cs" />
368364
<Compile Include="System\Windows\BinaryFormat\MemberPrimitiveTyped.cs" />
369-
<Compile Include="System\Windows\BinaryFormat\BinaryArray.cs" />
370365
<Compile Include="System\Windows\BinaryFormat\ClassWithMembersAndTypes.cs" />
371366
<Compile Include="System\Windows\BinaryFormat\SystemClassWithMembersAndTypes.cs" />
372367
<Compile Include="System\Windows\BinaryFormat\ClassInfo.cs" />
373368
<Compile Include="System\Windows\BinaryFormat\ClassRecord.cs" />
374369
<Compile Include="System\Windows\BinaryFormat\ClassWithId.cs" />
375370
<Compile Include="System\Windows\BinaryFormat\TypeInfo.cs" />
376-
<Compile Include="System\Windows\BinaryFormat\ClassWithMembers.cs" />
377-
<Compile Include="System\Windows\BinaryFormat\SystemClassWithMembers.cs" />
378371
<Compile Include="System\Windows\BinaryFormat\SerializationHeader.cs" />
379372
<Compile Include="System\Windows\BinaryFormat\ClassTypeInfo.cs" />
380-
<Compile Include="System\Windows\BinaryFormat\BinaryArrayType.cs" />
381-
<Compile Include="System\Windows\BinaryFormat\BinaryReaderExtensions.cs" />
382373
<Compile Include="System\Windows\BinaryFormat\BinaryWriterExtensions.cs" />
383374
<Compile Include="System\Windows\BinaryFormat\IntrinsicExtensions.cs" />
384375
<Compile Include="System\Windows\BinaryFormat\NullRecord.ObjectNullMultiple.cs" />
@@ -1461,6 +1452,7 @@
14611452
<NetCoreReference Include="System.Runtime.CompilerServices.VisualC" />
14621453
<NetCoreReference Include="System.Runtime.Extensions" />
14631454
<NetCoreReference Include="System.Runtime.InteropServices" />
1455+
<NetCoreReference Include="System.Runtime.Serialization.Formatters" />
14641456
<NetCoreReference Include="System.Text.Encoding.Extensions" />
14651457
<NetCoreReference Include="System.Text.RegularExpressions" />
14661458
<NetCoreReference Include="System.Threading" />
@@ -1476,10 +1468,9 @@
14761468

14771469
<ItemGroup>
14781470
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerPackageVersion)" />
1479-
<!-- PrivateAssets metadata is required as Packaging.props in WpfArcadeSdk unconditionally sets it to all which is wrong: https://github.com/dotnet/wpf/issues/9261. -->
1480-
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="$(SystemRuntimeSerializationFormattersPackageVersion)" PrivateAssets="contentfiles;analyzers;build" />
14811471
<PackageReference Include="System.Windows.Extensions" Version="$(SystemWindowsExtensionsPackageVersion)" />
14821472
<PackageReference Include="$(SystemIOPackagingPackage)" Version="$(SystemIOPackagingVersion)" />
1473+
<PackageReference Include="System.Formats.Nrbf" Version="$(SystemFormatsNrbfVersion)" />
14831474
</ItemGroup>
14841475

14851476
<ItemGroup>

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/BinaryFormat/ArrayInfo.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ public ArrayInfo(Id objectId, Count length)
2626
ObjectId = objectId;
2727
}
2828

29-
public static ArrayInfo Parse(BinaryReader reader, out Count length)
30-
{
31-
ArrayInfo arrayInfo = new(reader.ReadInt32(), reader.ReadInt32());
32-
length = arrayInfo.Length;
33-
return arrayInfo;
34-
}
35-
3629
public readonly void Write(BinaryWriter writer)
3730
{
3831
writer.Write(ObjectId);

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/BinaryFormat/ArraySingleObject.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,14 @@ namespace System.Windows
1616
/// </see>
1717
/// </para>
1818
/// </remarks>
19-
internal sealed class ArraySingleObject : ArrayRecord, IRecord<ArraySingleObject>
19+
internal sealed class ArraySingleObject : ArrayRecord
2020
{
2121
public static RecordType RecordType => RecordType.ArraySingleObject;
2222

2323
public ArraySingleObject(ArrayInfo arrayInfo, IReadOnlyList<object> arrayObjects)
2424
: base(arrayInfo, arrayObjects)
2525
{ }
2626

27-
static ArraySingleObject IBinaryFormatParseable<ArraySingleObject>.Parse(
28-
BinaryReader reader,
29-
RecordMap recordMap)
30-
{
31-
ArraySingleObject record = new(
32-
ArrayInfo.Parse(reader, out Count length),
33-
ReadRecords(reader, recordMap, length));
34-
35-
recordMap[record.ObjectId] = record;
36-
return record;
37-
}
38-
3927
public override void Write(BinaryWriter writer)
4028
{
4129
writer.Write((byte)RecordType);

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/BinaryFormat/ArraySinglePrimitive.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace System.Windows
1616
/// </see>
1717
/// </para>
1818
/// </remarks>
19-
internal sealed class ArraySinglePrimitive : ArrayRecord, IRecord<ArraySinglePrimitive>
19+
internal sealed class ArraySinglePrimitive : ArrayRecord
2020
{
2121
public PrimitiveType PrimitiveType { get; }
2222

@@ -28,22 +28,6 @@ public ArraySinglePrimitive(ArrayInfo arrayInfo, PrimitiveType primitiveType, IR
2828
PrimitiveType = primitiveType;
2929
}
3030

31-
static ArraySinglePrimitive IBinaryFormatParseable<ArraySinglePrimitive>.Parse(
32-
BinaryReader reader,
33-
RecordMap recordMap)
34-
{
35-
ArrayInfo arrayInfo = ArrayInfo.Parse(reader, out Count length);
36-
PrimitiveType primitiveType = (PrimitiveType)reader.ReadByte();
37-
38-
ArraySinglePrimitive record = new(
39-
arrayInfo,
40-
primitiveType,
41-
ReadPrimitiveTypes(reader, primitiveType, length));
42-
43-
recordMap[record.ObjectId] = record;
44-
return record;
45-
}
46-
4731
public override void Write(BinaryWriter writer)
4832
{
4933
writer.Write((byte)RecordType);

0 commit comments

Comments
 (0)