Skip to content

Commit

Permalink
Disable SYSLIB0016 warning
Browse files Browse the repository at this point in the history
This is a new obsoletion in System.Drawing. Disabling so we can consume the new build. Will follow this change with another that consumes the newer API.
  • Loading branch information
JeremyKuhne committed Apr 19, 2021
1 parent 7098999 commit a0ccc42
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 a0ccc42

Please sign in to comment.