Browse Source

Add

svn path=/trunk/mcs/; revision=1692
Ravi Pratap M 24 years ago
parent
commit
ce8a364511
3 changed files with 57 additions and 1 deletions
  1. 27 0
      mcs/errors/bug10.cs
  2. 0 1
      mcs/errors/bug7.cs
  3. 30 0
      mcs/errors/cs0070.cs

+ 27 - 0
mcs/errors/bug10.cs

@@ -0,0 +1,27 @@
+using System;
+
+public class Blah {
+
+	public void Connect ()
+	{
+	}
+
+	public void Button1_Click (int i, int j)
+	{
+		Console.WriteLine ("Button1 was clicked !");
+		Console.WriteLine ("Answer : " + (i+j));
+	}
+
+	public static int Main ()
+	{
+		Blah b = new Blah ();
+
+		b.Connect ();
+
+		b.OnClick ();
+
+		Console.WriteLine ("Test passes");
+		return 0;
+	}
+	
+}

+ 0 - 1
mcs/errors/bug7.cs

@@ -9,6 +9,5 @@ public class Y {
 	static void Main ()
 	{
 	}
-	
 }
 

+ 30 - 0
mcs/errors/cs0070.cs

@@ -0,0 +1,30 @@
+// cs0070.cs :  The event 'Click' can only appear on the left-side of a += or -= (except when used from within the type 'Button')
+// Line : 20
+
+using System;
+
+public delegate void EventHandler (int i, int j);
+
+public class Button {
+
+	public event EventHandler Click;
+
+}
+
+public class Blah {
+
+	Button Button1 = new Button ();
+
+	public void Connect ()
+	{
+		Button1.Click = new EventHandler (Button1_Click);
+	}
+
+	public void Button1_Click (int i, int j)
+	{
+	}
+	
+	public static void Main ()
+	{
+	}
+}