2003-07-17 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
[mono.git] / mcs / errors / cs0072.cs
1 // cs0072.cs: An event can override anything but another event.
2 // Line: 16
3
4 using System;
5
6 class ErrorCS0072 {
7         delegate void FooHandler ();
8         protected void Callback () {
9         }
10         protected virtual event FooHandler OnFoo;
11 }
12
13 class Child : ErrorCS0072 {
14         // We are trying to override a method with an event.
15         // To get this right comment the next line and uncomment the others below.
16         protected override event FooHandler Callback {
17         //protected override event FooHandler OnFoo {
18                 add {
19                         Callback += value;
20                         //OnFoo += value;
21                 }
22                 remove {
23                         Callback -= value;
24                         //OnFoo -= value;
25                 }
26         }
27
28         public static void Main () {
29         }
30 }
31