Skip to content

Commit

Permalink
Merge branch 'feature/9.0' into Issue_4908_Port_PropertyGridDesignerA…
Browse files Browse the repository at this point in the history
…ndNotifyIconDesigner
  • Loading branch information
Tanya-Solyanik committed Aug 10, 2023
2 parents 251491b + 6b3846a commit bde2ccb
Show file tree
Hide file tree
Showing 114 changed files with 16,955 additions and 15,907 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ indent_size = 4
[*.json]
indent_size = 2

# Bvc.dll crashed in the CI build when this rule is enabled for VB.
# C# files
[src/**/*.cs]
file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.
Expand Down
192 changes: 96 additions & 96 deletions eng/Version.Details.xml

Large diffs are not rendered by default.

64 changes: 32 additions & 32 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,38 @@
<PreReleaseVersionLabel>rc</PreReleaseVersionLabel>
<PreReleaseVersionIteration>1</PreReleaseVersionIteration>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<!-- Use the compiler in the CLI instead of in the sdk, since the sdk one doesn't work with netcoreapp5.0 yet -->
<UsingToolMicrosoftNetCompilers>false</UsingToolMicrosoftNetCompilers>
<UsingToolMicrosoftNetCompilers>true</UsingToolMicrosoftNetCompilers>
</PropertyGroup>
<!-- Below have corresponding entries in Versions.Details.XML because they are updated via Maestro -->
<PropertyGroup>
<VSRedistCommonNetCoreSharedFrameworkx6480PackageVersion>8.0.0-rc.1.23401.22</VSRedistCommonNetCoreSharedFrameworkx6480PackageVersion>
<SystemDiagnosticsEventLogPackageVersion>8.0.0-rc.1.23401.22</SystemDiagnosticsEventLogPackageVersion>
<SystemDirectoryServicesPackageVersion>8.0.0-rc.1.23401.22</SystemDirectoryServicesPackageVersion>
<SystemReflectionMetadataLoadContextPackageVersion>8.0.0-rc.1.23401.22</SystemReflectionMetadataLoadContextPackageVersion>
<SystemSecurityCryptographyXmlPackageVersion>8.0.0-rc.1.23401.22</SystemSecurityCryptographyXmlPackageVersion>
<SystemIOPackagingPackageVersion>8.0.0-rc.1.23401.22</SystemIOPackagingPackageVersion>
<VSRedistCommonNetCoreSharedFrameworkx6480PackageVersion>8.0.0-rc.1.23408.18</VSRedistCommonNetCoreSharedFrameworkx6480PackageVersion>
<SystemDiagnosticsEventLogPackageVersion>8.0.0-rc.1.23408.18</SystemDiagnosticsEventLogPackageVersion>
<SystemDirectoryServicesPackageVersion>8.0.0-rc.1.23408.18</SystemDirectoryServicesPackageVersion>
<SystemReflectionMetadataLoadContextPackageVersion>8.0.0-rc.1.23408.18</SystemReflectionMetadataLoadContextPackageVersion>
<SystemSecurityCryptographyXmlPackageVersion>8.0.0-rc.1.23408.18</SystemSecurityCryptographyXmlPackageVersion>
<SystemIOPackagingPackageVersion>8.0.0-rc.1.23408.18</SystemIOPackagingPackageVersion>
<MicrosoftNETCoreRuntimeCoreCLRPackageVersion>5.0.0-preview.7.20320.5</MicrosoftNETCoreRuntimeCoreCLRPackageVersion>
<MicrosoftNETCoreILDAsmPackageVersion>8.0.0-rc.1.23401.22</MicrosoftNETCoreILDAsmPackageVersion>
<SystemDiagnosticsPerformanceCounterPackageVersion>8.0.0-rc.1.23401.22</SystemDiagnosticsPerformanceCounterPackageVersion>
<MicrosoftNETCoreILDAsmPackageVersion>8.0.0-rc.1.23408.18</MicrosoftNETCoreILDAsmPackageVersion>
<SystemDiagnosticsPerformanceCounterPackageVersion>8.0.0-rc.1.23408.18</SystemDiagnosticsPerformanceCounterPackageVersion>
<SystemRuntimeCompilerServicesUnsafePackageVersion>6.0.0</SystemRuntimeCompilerServicesUnsafePackageVersion>
<SystemSecurityCryptographyPkcsPackageVersion>8.0.0-rc.1.23401.22</SystemSecurityCryptographyPkcsPackageVersion>
<SystemSecurityCryptographyProtectedDataPackageVersion>8.0.0-rc.1.23401.22</SystemSecurityCryptographyProtectedDataPackageVersion>
<SystemTextEncodingsWebPackageVersion>8.0.0-rc.1.23401.22</SystemTextEncodingsWebPackageVersion>
<SystemTextJsonPackageVersion>8.0.0-rc.1.23401.22</SystemTextJsonPackageVersion>
<SystemThreadingAccessControlPackageVersion>8.0.0-rc.1.23401.22</SystemThreadingAccessControlPackageVersion>
<MicrosoftWin32RegistryAccessControlPackageVersion>8.0.0-rc.1.23401.22</MicrosoftWin32RegistryAccessControlPackageVersion>
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-rc.1.23401.22</MicrosoftNETCoreAppRefPackageVersion>
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>8.0.0-rc.1.23401.22</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
<MicrosoftNETCorePlatformsPackageVersion>8.0.0-rc.1.23401.22</MicrosoftNETCorePlatformsPackageVersion>
<MicrosoftWin32SystemEventsPackageVersion>8.0.0-rc.1.23401.22</MicrosoftWin32SystemEventsPackageVersion>
<SystemCodeDomPackageVersion>8.0.0-rc.1.23401.22</SystemCodeDomPackageVersion>
<SystemConfigurationConfigurationManagerPackageVersion>8.0.0-rc.1.23401.22</SystemConfigurationConfigurationManagerPackageVersion>
<SystemResourcesExtensionsPackageVersion>8.0.0-rc.1.23401.22</SystemResourcesExtensionsPackageVersion>
<SystemSecurityPermissionsPackageVersion>8.0.0-rc.1.23401.22</SystemSecurityPermissionsPackageVersion>
<SystemWindowsExtensionsPackageVersion>8.0.0-rc.1.23401.22</SystemWindowsExtensionsPackageVersion>
<MicrosoftNETCoreILAsmPackageVersion>8.0.0-rc.1.23401.22</MicrosoftNETCoreILAsmPackageVersion>
<runtimewinx64MicrosoftNETCoreILAsmPackageVersion>8.0.0-rc.1.23401.22</runtimewinx64MicrosoftNETCoreILAsmPackageVersion>
<runtimewinx86MicrosoftNETCoreILAsmPackageVersion>8.0.0-rc.1.23401.22</runtimewinx86MicrosoftNETCoreILAsmPackageVersion>
<SystemSecurityCryptographyPkcsPackageVersion>8.0.0-rc.1.23408.18</SystemSecurityCryptographyPkcsPackageVersion>
<SystemSecurityCryptographyProtectedDataPackageVersion>8.0.0-rc.1.23408.18</SystemSecurityCryptographyProtectedDataPackageVersion>
<SystemTextEncodingsWebPackageVersion>8.0.0-rc.1.23408.18</SystemTextEncodingsWebPackageVersion>
<SystemTextJsonPackageVersion>8.0.0-rc.1.23408.18</SystemTextJsonPackageVersion>
<SystemThreadingAccessControlPackageVersion>8.0.0-rc.1.23408.18</SystemThreadingAccessControlPackageVersion>
<MicrosoftWin32RegistryAccessControlPackageVersion>8.0.0-rc.1.23408.18</MicrosoftWin32RegistryAccessControlPackageVersion>
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-rc.1.23408.18</MicrosoftNETCoreAppRefPackageVersion>
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>8.0.0-rc.1.23408.18</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
<MicrosoftNETCorePlatformsPackageVersion>8.0.0-rc.1.23408.18</MicrosoftNETCorePlatformsPackageVersion>
<MicrosoftWin32SystemEventsPackageVersion>8.0.0-rc.1.23408.18</MicrosoftWin32SystemEventsPackageVersion>
<SystemCodeDomPackageVersion>8.0.0-rc.1.23408.18</SystemCodeDomPackageVersion>
<SystemConfigurationConfigurationManagerPackageVersion>8.0.0-rc.1.23408.18</SystemConfigurationConfigurationManagerPackageVersion>
<SystemResourcesExtensionsPackageVersion>8.0.0-rc.1.23408.18</SystemResourcesExtensionsPackageVersion>
<SystemSecurityPermissionsPackageVersion>8.0.0-rc.1.23408.18</SystemSecurityPermissionsPackageVersion>
<SystemWindowsExtensionsPackageVersion>8.0.0-rc.1.23408.18</SystemWindowsExtensionsPackageVersion>
<MicrosoftNETCoreILAsmPackageVersion>8.0.0-rc.1.23408.18</MicrosoftNETCoreILAsmPackageVersion>
<runtimewinx64MicrosoftNETCoreILAsmPackageVersion>8.0.0-rc.1.23408.18</runtimewinx64MicrosoftNETCoreILAsmPackageVersion>
<runtimewinx86MicrosoftNETCoreILAsmPackageVersion>8.0.0-rc.1.23408.18</runtimewinx86MicrosoftNETCoreILAsmPackageVersion>
<!--
Microsoft.NET.Sdk.IL.targets requires definition of MicrosoftNETCoreILAsmVersion
-->
Expand All @@ -53,9 +52,9 @@
</PropertyGroup>
<!-- Arcade -->
<PropertyGroup>
<MicrosoftDotNetGenFacadesPackageVersion>8.0.0-beta.23401.3</MicrosoftDotNetGenFacadesPackageVersion>
<MicrosoftDotNetRemoteExecutorVersion>8.0.0-beta.23401.3</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetXUnitExtensionsPackageVersion>8.0.0-beta.23401.3</MicrosoftDotNetXUnitExtensionsPackageVersion>
<MicrosoftDotNetGenFacadesPackageVersion>8.0.0-beta.23407.1</MicrosoftDotNetGenFacadesPackageVersion>
<MicrosoftDotNetRemoteExecutorVersion>8.0.0-beta.23407.1</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetXUnitExtensionsPackageVersion>8.0.0-beta.23407.1</MicrosoftDotNetXUnitExtensionsPackageVersion>
<MicrosoftNETTestSdkVersion>17.4.0-preview-20220707-01</MicrosoftNETTestSdkVersion>
</PropertyGroup>
<!-- Below have no corresponding entries in Versions.Details.XML because they are not updated via Maestro -->
Expand Down Expand Up @@ -91,14 +90,15 @@
<CSharpIsNullAnalyzersVersion>0.1.329</CSharpIsNullAnalyzersVersion>
<DotNetAnalyzersDocumentationAnalyzersVersion>1.0.0-beta.59</DotNetAnalyzersDocumentationAnalyzersVersion>
<MicrosoftCodeAnalysisAnalyzersVersion>3.3.5-beta1.23327.3</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisCommonPackageVersion>4.4.0</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCommonPackageVersion>4.8.0-1.23378.8</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>$(MicrosoftCodeAnalysisCommonPackageVersion)</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisVisualBasicPackageVersion>$(MicrosoftCodeAnalysisCommonPackageVersion)</MicrosoftCodeAnalysisVisualBasicPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>$(MicrosoftCodeAnalysisCommonPackageVersion)</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
<MicrosoftCodeAnalysisVisualBasicWorkspacesVersion>$(MicrosoftCodeAnalysisCommonPackageVersion)</MicrosoftCodeAnalysisVisualBasicWorkspacesVersion>
<MicrosoftCodeAnalysisPackagesVersion>1.1.2-beta1.23322.1</MicrosoftCodeAnalysisPackagesVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>$(MicrosoftCodeAnalysisAnalyzersVersion)</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0-preview.23327.3</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftNetCompilersToolsetVersion>4.8.0-1.23403.1</MicrosoftNetCompilersToolsetVersion>
<StyleCopAnalyzersVersion>1.2.0-beta.507</StyleCopAnalyzersVersion>
</PropertyGroup>
<!-- Additional unchanging dependencies -->
Expand Down
Binary file modified eng/common/loc/P22DotNetHtmlLocalization.lss
Binary file not shown.
9 changes: 9 additions & 0 deletions eng/common/templates/steps/source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,12 @@ steps:
artifactName: BuildLogs_SourceBuild_${{ parameters.platform.name }}_Attempt$(System.JobAttempt)
continueOnError: true
condition: succeededOrFailed()

# Manually inject component detection so that we can ignore the source build upstream cache, which contains
# a nupkg cache of input packages (a local feed).
# This path must match the upstream cache path in property 'CurrentRepoSourceBuiltNupkgCacheDir'
# in src\Microsoft.DotNet.Arcade.Sdk\tools\SourceBuild\SourceBuildArcade.targets
- task: ComponentGovernanceComponentDetection@0
displayName: Component Detection (Exclude upstream cache)
inputs:
ignoreDirectories: '$(Build.SourcesDirectory)/artifacts/source-build/self/src/artifacts/obj/source-built-upstream-cache'
8 changes: 4 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"version": "8.0.100-preview.6.23330.14"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23401.3",
"Microsoft.DotNet.CMake.Sdk": "8.0.0-beta.23401.3",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23401.3",
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23407.1",
"Microsoft.DotNet.CMake.Sdk": "8.0.0-beta.23407.1",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23407.1",
"FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0",
"Microsoft.NET.Sdk.IL": "8.0.0-rc.1.23401.22"
"Microsoft.NET.Sdk.IL": "8.0.0-rc.1.23408.18"
},
"native-tools": {
"cmake": "latest"
Expand Down
3 changes: 3 additions & 0 deletions src/System.Design/src/System.Design.Forwards.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.PrintDialogDesigner))]
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.RadioButtonDesigner))]
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.RichTextBoxDesigner))]
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.SaveFileDialogDesigner))]
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.SplitContainerDesigner))]
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.SplitterPanelDesigner))]
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.SplitterDesigner))]
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.FlowLayoutPanelDesigner))]
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.FolderBrowserDialogDesigner))]
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.TabControlDesigner))]
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.TableLayoutPanelDesigner))]
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.TabPageDesigner))]
Expand Down
8 changes: 4 additions & 4 deletions src/System.Drawing.Common/src/NotSupported.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ public partial struct CharacterRange
{
private int _dummyPrimitive;
public CharacterRange(int First, int Length) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
public int First { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
public int Length { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
public override int GetHashCode() { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
public int First { readonly get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
public int Length { readonly get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } }
public override readonly bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
public override readonly int GetHashCode() { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
public static bool operator ==(System.Drawing.CharacterRange cr1, System.Drawing.CharacterRange cr2) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
public static bool operator !=(System.Drawing.CharacterRange cr1, System.Drawing.CharacterRange cr2) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
}
Expand Down
10 changes: 5 additions & 5 deletions src/System.Drawing.Common/src/System/Drawing/CharacterRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@ public CharacterRange(int First, int Length)
/// <summary>Gets the First character position of this <see cref='CharacterRange'/>.</summary>
public int First
{
get => _first;
readonly get => _first;
set => _first = value;
}

/// <summary>Gets the Length of this <see cref='CharacterRange'/>.</summary>
public int Length
{
get => _length;
readonly get => _length;
set => _length = value;
}

public override bool Equals([NotNullWhen(true)] object? obj) =>
public override readonly bool Equals([NotNullWhen(true)] object? obj) =>
obj is CharacterRange other && Equals(other);

/// <summary>Indicates whether the current instance is equal to another instance of the same type.</summary>
/// <param name="other">An instance to compare with this instance.</param>
/// <returns>true if the current instance is equal to the other instance; otherwise, false.</returns>
public bool Equals(CharacterRange other) => First == other.First && Length == other.Length;
public readonly bool Equals(CharacterRange other) => First == other.First && Length == other.Length;

public static bool operator ==(CharacterRange cr1, CharacterRange cr2) => cr1.Equals(cr2);

public static bool operator !=(CharacterRange cr1, CharacterRange cr2) => !cr1.Equals(cr2);

public override int GetHashCode() => HashCode.Combine(First, Length);
public override readonly int GetHashCode() => HashCode.Combine(First, Length);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
namespace System.Drawing;

/// <summary>
/// The ComWrappers implementation for System.Drawing.Common's COM interop usages.
///
/// Supports IStream and IPicture COM interfaces.
/// The ComWrappers implementation for System.Drawing.Common's COM interop usages.
/// </summary>
/// <remarks>
/// <para>
/// Supports IStream and IPicture COM interfaces.
/// </para>
/// </remarks>
internal unsafe partial class DrawingCom : ComWrappers
{
private const int S_OK = (int)HRESULT.S_OK;
Expand Down Expand Up @@ -52,7 +55,11 @@ protected override object CreateObject(IntPtr externalComObject, CreateObjectFla
Debug.Assert(flags == CreateObjectFlags.UniqueInstance);

Guid pictureIID = IPicture.IID;
#if NET8_0_OR_GREATER
int hr = Marshal.QueryInterface(externalComObject, in pictureIID, out IntPtr comObject);
#else
int hr = Marshal.QueryInterface(externalComObject, ref pictureIID, out IntPtr comObject);
#endif
if (hr == S_OK)
{
return new PictureWrapper(comObject);
Expand All @@ -71,11 +78,16 @@ internal static IStreamWrapper GetComWrapper(Ole32.IStream stream)
IntPtr streamWrapperPtr = Instance.GetOrCreateComInterfaceForObject(stream, CreateComInterfaceFlags.None);

Guid streamIID = IID_IStream;
int result = Marshal.QueryInterface(streamWrapperPtr, ref streamIID, out IntPtr streamPtr);

#if NET8_0_OR_GREATER
int hr = Marshal.QueryInterface(streamWrapperPtr, in streamIID, out IntPtr streamPtr);
#else
int hr = Marshal.QueryInterface(streamWrapperPtr, ref streamIID, out IntPtr streamPtr);
#endif

Marshal.Release(streamWrapperPtr);

ThrowExceptionForHR(result);
ThrowExceptionForHR(hr);

return new IStreamWrapper(streamPtr);
}
Expand Down Expand Up @@ -308,7 +320,12 @@ public unsafe int SaveAsFile(IntPtr pstm, int fSaveMemCopy, int* pcbSize)
{
// Get the IStream implementation, since the ComWrappers runtime returns a pointer to the IUnknown interface implementation
Guid streamIID = IID_IStream;

#if NET8_0_OR_GREATER
ThrowExceptionForHR(Marshal.QueryInterface(pstm, in streamIID, out IntPtr pstmImpl));
#else
ThrowExceptionForHR(Marshal.QueryInterface(pstm, ref streamIID, out IntPtr pstmImpl));
#endif

try
{
Expand Down
3 changes: 1 addition & 2 deletions src/System.Drawing.Common/src/System/Drawing/Font.cs
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,7 @@ static unsafe Font FromLogFont(in LOGFONT logFont, IntPtr hdc)
throw new ArgumentException(SR.Format(SR.GdiplusNotTrueTypeFont, logFont.AsString()));
}

bool gdiVerticalFont = logFont.lfFaceName[0] == '@';
return new Font(font, logFont.lfCharSet, gdiVerticalFont);
return new Font(font, logFont.lfCharSet, logFont.IsGdiVerticalFont);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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.CompilerServices;
using System.Runtime.InteropServices;

namespace System.Drawing.Interop;
Expand Down Expand Up @@ -31,16 +32,18 @@ unsafe struct LOGFONT
public byte lfPitchAndFamily;
private fixed char _lfFaceName[LF_FACESIZE];

internal readonly bool IsGdiVerticalFont => _lfFaceName[0] == '@';

#if NET7_0_OR_GREATER
[UnscopedRef]
#endif
public Span<char> lfFaceName => MemoryMarshal.CreateSpan(ref _lfFaceName[0], LF_FACESIZE);

internal string AsString()
internal readonly string AsString()
#pragma warning disable format
=> $"lfHeight={lfHeight}, lfWidth={lfWidth}, lfEscapement={lfEscapement}, lfOrientation={lfOrientation
}, lfWeight={lfWeight}, lfItalic={lfItalic}, lfUnderline={lfUnderline}, lfStrikeOut={lfStrikeOut
}, lfCharSet={lfCharSet}, lfOutPrecision={lfOutPrecision}, lfClipPrecision={lfClipPrecision
}, lfQuality={lfQuality}, lfPitchAndFamily={lfPitchAndFamily}, lfFaceName={lfFaceName}";
}, lfQuality={lfQuality}, lfPitchAndFamily={lfPitchAndFamily}, lfFaceName={Unsafe.AsRef(in this).lfFaceName}";
#pragma warning restore format
}
Loading

0 comments on commit bde2ccb

Please sign in to comment.