Make DispatchProxy declares Property/EventInfos of the interface.
authoryfakariya <yfakariya@gmail.com>
Sat, 18 Jun 2016 09:19:38 +0000 (18:19 +0900)
committeryfakariya <yfakariya@gmail.com>
Thu, 23 Jun 2016 15:07:58 +0000 (00:07 +0900)
commit9d46ffcec086bb22cdeb4325b5f695b5860261b9
tree3c2f08bde5237044fe83d77fbf9b1cc38d4e0334
parent86845a3e8b01f65cbe5bc830a4a526d2f0aea7e3
Make DispatchProxy declares Property/EventInfos of the interface.

This commit adds code to declare properties and events
to generating proxy type as well.

Note
* Because declaring properties and events requires accessor methods,
  this commit changes AddMethodImpl to return created MethodBuilder.
* This declares EqualityComparer for MethodInfo to avoid reference based
  comparison.
* The test case now uses System.Reflection.Emit to generate the event
  with raise_ method which is not supported in C#.

Commit migrated from https://github.com/dotnet/corefx/commit/e8f650d67a67003786c04b916dc4805678237c0a
src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxyGenerator.cs
src/libraries/System.Reflection.DispatchProxy/tests/DispatchProxyTests.cs
src/libraries/System.Reflection.DispatchProxy/tests/TestTypes.cs
src/libraries/System.Reflection.DispatchProxy/tests/project.json