Skip to content

Commit

Permalink
Merge pull request #4811 (#4812)
Browse files Browse the repository at this point in the history
Disable SYSLIB0016 warning
  • Loading branch information
JeremyKuhne authored Apr 19, 2021
1 parent ecfb941 commit 1bed4d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
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

0 comments on commit 1bed4d0

Please sign in to comment.