winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Write test(s) to ensure that all TypeConverter and Editor Attributes on internals are properly routed

Open zsd4yr opened this issue 6 years ago • 1 comments

For each TypeConverter and Editor attribute connecting a type to its type converter or editor by a fully qualified string, we need a TypeForwardTo attribute in the corresponding facade. This is required as GenFacades will not automatically generate TypeForwardTo statements for internals.

Please see https://github.com/dotnet/winforms/pull/2078#discussion_r337787642 for more details on the history of this need and discussion.

Suggestion: write a unit test that rolls over every assembly we own and uses reflection to determine which internal types, properties, and methods have these attributes. Then, for each of those that exist, determine whether or not that type was in an assembly that we now type forward from. If so, ensure that there is a manually added TypeForwardTo statement in the facades.

zsd4yr avatar Oct 23 '19 17:10 zsd4yr

use reflection to determine which internal types, properties, and methods have these attributes

That statement is misleading, you want to figure out all internal types which are targeted by TypeConverter/Editor attributes within WinForms:

  • methods shouldn't have TypeConverter/Editor attributes
  • you scan all types/props, not just internal ones
  • you look for attributes referencing internal types in their argument

weltkante avatar Oct 23 '19 19:10 weltkante