Using reflection to add handler for user preference events (dotnet/corefx#37853)
authorAnirudh Agnihotry <anirudhagnihotry098@gmail.com>
Thu, 30 May 2019 20:15:16 +0000 (13:15 -0700)
committermsftbot[bot] <msftbot[bot]@users.noreply.github.com>
Thu, 30 May 2019 20:15:16 +0000 (20:15 +0000)
commit608a743baca6fcc221cf2e704685d5fbfc393eff
treead263717209b9bb4818609c952404047062d4678
parent11077218ad3041197506d8356165b270d0b1fca4
Using reflection to add handler for user preference events (dotnet/corefx#37853)

* using reflection to add handler for user preference events

* adding comments, correcting typo and using GetType

* adding debug.asserts

* pushing down color translator

* using open unbound delegate pointing directly to getter method of the eventargs category property

* No longer using colorTable on netcoreapp 2.1 in system.Drawing.Common

* reverting the use of extension method.

* doing  s_color check first and adding null check for category getter

* missing semicolon

* improving comments and adding tests

* removing extra using

* using already defined known color

* skipping the test on nano and non-windows platform

* introducing a custom property

Commit migrated from https://github.com/dotnet/corefx/commit/d24b3e33e66bfd0733f9c01fa810336d76a8872f
src/libraries/Common/src/System/Drawing/ColorTranslator.cs [moved from src/libraries/System.Drawing.Common/src/System/Drawing/ColorTranslator.cs with 100% similarity]
src/libraries/Common/src/System/Drawing/KnownColorTable.cs
src/libraries/System.Drawing.Common/ref/System.Drawing.Common.Forwards.cs
src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs
src/libraries/System.Drawing.Common/ref/System.Drawing.Common.netstandard.cs
src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj
src/libraries/System.Drawing.Primitives/ref/System.Drawing.Primitives.cs
src/libraries/System.Drawing.Primitives/src/Resources/Strings.resx
src/libraries/System.Drawing.Primitives/src/System.Drawing.Primitives.csproj
src/libraries/System.Drawing.Primitives/tests/ColorTests.cs