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

Implement new GetContextInfo API overloads #49186

Merged
merged 12 commits into from
Apr 16, 2021
Prev Previous commit
Next Next commit
Address feedback
  • Loading branch information
JeremyKuhne committed Apr 15, 2021
commit 7bb81556ae514485418458e838597526997a68c5
2 changes: 1 addition & 1 deletion src/libraries/Common/src/System/Obsoletions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ internal static class Obsoletions
internal const string DisablePrivateReflectionAttributeDiagId = "SYSLIB0015";

internal const string GetContextInfoMessage = "Use the Graphics.GetContextInfo overloads that accept arguments for better performance and fewer allocations.";
internal const string GetContextInfoId = "SYSLIB0016";
internal const string GetContextInfoDiagId = "SYSLIB0016";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,7 @@ public void Flush(System.Drawing.Drawing2D.FlushIntention intention) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
#if NET50_OBSOLETIONS
[System.ObsoleteAttribute(Obsoletions.GetContextInfoMessage, DiagnosticId = Obsoletions.GetContextInfoId, UrlFormat = Obsoletions.SharedUrlFormat)]
#else
[System.ObsoleteAttribute(Obsoletions.GetContextInfoMessage)]
[System.ObsoleteAttribute("Use the Graphics.GetContextInfo overloads that accept arguments for better performance and fewer allocations.", DiagnosticId = "SYSLIB0016", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
#endif
public object GetContextInfo() { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
<ItemGroup>
<Compile Include="System.Drawing.Common.cs" />
<Compile Include="System.Drawing.Common.Forwards.cs" />
<Compile Include="$(CommonPath)System\Obsoletions.cs"
Link="Common\System\Obsoletions.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp3.0'">
<ProjectReference Include="..\..\System.Collections.NonGeneric\ref\System.Collections.NonGeneric.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ public unsafe void EnumerateMetafile(
/// WARNING: This method is for internal FX support only.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete(Obsoletions.GetContextInfoMessage, DiagnosticId = Obsoletions.GetContextInfoId, UrlFormat = Obsoletions.SharedUrlFormat)]
[Obsolete(Obsoletions.GetContextInfoMessage, DiagnosticId = Obsoletions.GetContextInfoDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
[SupportedOSPlatform("windows")]
public object GetContextInfo()
{
Expand Down