Advertisement
Guest User

Untitled

a guest
May 27th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. void Main()
  2. {
  3.     var m = typeof(Foo).GetMethod("Test123");
  4.     var d = m.CreateDelegate(typeof(MessageHandlingDelegate));
  5. }
  6.  
  7. public delegate bool MessageHandlingDelegate(Match match);
  8.  
  9. // Define other methods and classes here
  10. public class Foo
  11. {  
  12.     public bool Test123(Match match)
  13.     {
  14.         return true;
  15.     }
  16. }
  17.  
  18. Exception: Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement