diff options
author | Jaime Anguiano Olarra <jaime@mono-cvs.ximian.com> | 2002-12-03 20:33:10 +0300 |
---|---|---|
committer | Jaime Anguiano Olarra <jaime@mono-cvs.ximian.com> | 2002-12-03 20:33:10 +0300 |
commit | ef029ba358a98a18edd5ded5efdf802f11737b1a (patch) | |
tree | 29acca660f2156184ef8059afd3f0c65af0545e2 /mcs/errors/cs0079.cs | |
parent | c4885b2537b98dcad136bff88d4d3c06ff358b2e (diff) |
With these new tests (73-79) we have completed the tests from CS0001 to
CS0100 for the compiler.
svn path=/trunk/mcs/; revision=9369
Diffstat (limited to 'mcs/errors/cs0079.cs')
-rw-r--r-- | mcs/errors/cs0079.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mcs/errors/cs0079.cs b/mcs/errors/cs0079.cs new file mode 100644 index 00000000000..d82ce8f8fa7 --- /dev/null +++ b/mcs/errors/cs0079.cs @@ -0,0 +1,29 @@ +// cs0079.cs: Events can only appear on the left hand side of += or -= +// Line: 19 + +using System; + +class ErrorCS0079 { + delegate void Handler (); + event Handler privateEvent; + public event Handler OnFoo { + add { + privateEvent += value; + } + remove { + privateEvent -= value; + } + } + void Callback() { + if (privateEvent != null) + OnFoo(); + } + + public static void Main () { + ErrorCS0079 error = new ErrorCS0077 (); + error.OnFoo += new Handler (error.Callback); + error.privateEvent (); + } +} + + |