Guest User

Untitled

a guest
Jan 12th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1. public class A
  2. {
  3.     public delegate void D();
  4.     public event D E;
  5.  
  6.     public void DoSomething() { /* ... */ }
  7.  
  8.     public A()
  9.     {
  10.         E += DoSomething;
  11.     }
  12. }
  13.  
  14. public class B
  15. {
  16.     public static void Main(string[] args)
  17.     {
  18.         A a = new A();
  19.         a.E(); // error
  20.     }
  21. }
Add Comment
Please, Sign In to add comment