add test to confirm behavior of Control.SetVisibleCore, and remove some redundant...
[mcs.git] / tests / test-83.cs
blobf416ddb4a6dfb3e26203ebbefe72d720da1ee876
1 //
2 // This test probes that we treat events differently than fields
3 // This used to cause a compiler crash.
4 //
5 using System;
7 delegate void PersonArrivedHandler (object source, PersonArrivedArgs args);
9 class PersonArrivedArgs /*: EventArgs*/ {
10 public string name;
11 public PersonArrivedArgs (string name) {
12 this.name = name;
16 class Greeter {
17 string greeting;
19 public Greeter (string greeting) {
20 this.greeting = greeting;
23 public void HandlePersonArrived (object source, PersonArrivedArgs args) {
24 Console.WriteLine(greeting, args.name);
28 class Room {
29 public event PersonArrivedHandler PersonArrived;
31 public Room () {
32 // Assign a value to it, this also used to crash the compiler.
33 PersonArrived = null;
36 public void AddPerson (string name) {
37 PersonArrived(this, null); //(this, PersonArrivedArgs(name));
41 class DelegateTest {
42 static int Main () {
43 return 0;