[Zope-CVS] CVS: PythonNet/src/testing - ClassTest.cs:1.3
EventTest.cs:1.5
Brian Lloyd
cvs-admin at zope.org
Wed Nov 5 22:35:42 EST 2003
Update of /cvs-repository/PythonNet/src/testing
In directory cvs.zope.org:/tmp/cvs-serv19508/src/testing
Modified Files:
ClassTest.cs EventTest.cs
Log Message:
Fixed event support; added keyfile to buildout; fixed exception obsfucation
in property accessors.
=== PythonNet/src/testing/ClassTest.cs 1.2 => 1.3 ===
--- PythonNet/src/testing/ClassTest.cs:1.2 Tue Sep 30 19:54:12 2003
+++ PythonNet/src/testing/ClassTest.cs Wed Nov 5 22:35:11 2003
@@ -11,6 +11,7 @@
using System;
using System.Collections;
+using System.Windows.Forms;
namespace Python.Test {
@@ -46,5 +47,6 @@
}
+
}
=== PythonNet/src/testing/EventTest.cs 1.4 => 1.5 ===
--- PythonNet/src/testing/EventTest.cs:1.4 Mon Oct 27 21:07:02 2003
+++ PythonNet/src/testing/EventTest.cs Wed Nov 5 22:35:11 2003
@@ -10,6 +10,7 @@
// FOR A PARTICULAR PURPOSE.
using System;
+using System.Windows.Forms;
namespace Python.Test {
@@ -22,6 +23,22 @@
public class EventTest {
+
+ public void WinFormTest() {
+ EventTest e = new EventTest();
+ EventHandler h = new EventHandler(e.ClickHandler);
+
+ Form f = new Form();
+ f.Click += h;
+ //f.Click(null, new EventArgs());
+ f.Click -= h;
+ }
+
+ public void ClickHandler(object sender, EventArgs e) {
+ Console.WriteLine("click");
+ }
+
+
public static event TestEventHandler PublicStaticEvent;
protected static event TestEventHandler ProtectedStaticEvent;
@@ -50,17 +67,34 @@
s_value = 0;
}
- public static void FireStatic(TestEventArgs e) {
+
+ public void OnPublicEvent(TestEventArgs e) {
+ if (PublicEvent != null) {
+ PublicEvent(this, e);
+ }
+ }
+
+
+ public void OnProtectedEvent(TestEventArgs e) {
+ if (ProtectedEvent != null) {
+ ProtectedEvent(this, e);
+ }
+ }
+
+
+ public static void OnPublicStaticEvent(TestEventArgs e) {
if (PublicStaticEvent != null) {
PublicStaticEvent(null, e);
}
}
- public void FireEvent(TestEventArgs e) {
- if (PublicEvent != null) {
- PublicEvent(this, e);
+
+ protected static void OnProtectedStaticEvent(TestEventArgs e) {
+ if (ProtectedStaticEvent != null) {
+ ProtectedStaticEvent(null, e);
}
}
+
public void GenericHandler(object sender, TestEventArgs e) {
this.value = e.value;
More information about the Zope-CVS
mailing list