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

Disable SYSLIB0016 warning #4811

Merged
merged 1 commit into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ public unsafe DeviceContextHdcScope(
bool applyTransform = applyGraphicsState.HasFlag(ApplyGraphicsProperties.TranslateTransform);
bool applyClipping = applyGraphicsState.HasFlag(ApplyGraphicsProperties.Clipping);

#pragma warning disable SYSLIB0016 // Type or member is obsolete
// This API is very expensive and cannot be called after GetHdc()
object[]? data = applyTransform || applyClipping ? (object[])graphics.GetContextInfo() : null;
#pragma warning restore SYSLIB0016 // Type or member is obsolete

using Region? clipRegion = (Region?)data?[0];
using Matrix? worldTransform = (Matrix?)data?[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ internal static void CheckGraphicsForState(Graphics? graphics, DrawingEventFlags
return;
}

#pragma warning disable SYSLIB0016 // Type or member is obsolete
// Check to see if we've actually corrupted the state
object[] data = (object[])graphics.GetContextInfo();
#pragma warning restore SYSLIB0016 // Type or member is obsolete

using Region clipRegion = (Region)data[0];
using Matrix worldTransform = (Matrix)data[1];
Expand Down