Guest User

Untitled

a guest
Oct 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. private static void PrintInterfaceMappingUsingGetInterfaceMap(Type type, Type interfaceType)
  2. {
  3. InterfaceMapping mapping = type.GetInterfaceMap(interfaceType);
  4.  
  5. int count = mapping.InterfaceMethods.Count();
  6.  
  7. Console.WriteLine(
  8. "Interface Type Name: {0}, Target Type Name: {1}",
  9. mapping.InterfaceType.FullName,
  10. mapping.TargetType.FullName);
  11.  
  12. for (int i = 0; i < count; i++)
  13. {
  14. Console.WriteLine(
  15. "Interface Method: {0}, Implemented method: {0}",
  16. mapping.InterfaceMethods[i].Name,
  17. mapping.TargetMethods[i]);
  18. }
  19. }
Add Comment
Please, Sign In to add comment