2009-01-24 Zoltan Varga <vargaz@gmail.com>
[mcs.git] / tests / gtest-anon-36.cs
blobb7e84293c9fee724e779d1922fa18fa6b3aa008c
1 using System;
3 delegate void Handler<T> (object sender);
5 interface IBar<T> {
6 event Handler<T> Handler;
9 class Foo<T> {
11 IBar<T> proxy, real;
13 event Handler<T> handler;
15 Handler<T> proxyHandler;
17 public event Handler<T> Handler {
18 add {
19 if (handler == null) {
20 if (proxyHandler == null)
21 proxyHandler = (object s) => handler (proxy);
23 handler += value;
25 remove {
26 handler -= value;
31 class Program {
33 static int Main ()
35 var x = new Foo<int> ();
36 x.Handler += null;
37 return 0;