[Zope-CVS] CVS: PythonNet/src/testing - EventTest.cs:1.2
Brian Lloyd
brian at zope.com
Thu Oct 2 23:06:51 EDT 2003
Update of /cvs-repository/PythonNet/src/testing
In directory cvs.zope.org:/tmp/cvs-serv5985/src/testing
Modified Files:
EventTest.cs
Log Message:
Checkin partial event fixes and refactoring
=== PythonNet/src/testing/EventTest.cs 1.1 => 1.2 ===
--- PythonNet/src/testing/EventTest.cs:1.1 Mon Jul 14 16:00:05 2003
+++ PythonNet/src/testing/EventTest.cs Thu Oct 2 23:06:20 2003
@@ -17,9 +17,60 @@
// Supports CLR event unit tests.
//========================================================================
+ public delegate void TestEventHandler(object sender, TestEventArgs e);
+
+
public class EventTest {
+ public static event TestEventHandler PublicStaticEvent;
+
+ protected static event TestEventHandler ProtectedStaticEvent;
+
+ internal static event TestEventHandler InternalStaticEvent;
+
+ private static event TestEventHandler PrivateStaticEvent;
+
+ public event TestEventHandler PublicEvent;
+
+ protected event TestEventHandler ProtectedEvent;
+
+ internal event TestEventHandler InternalEvent;
+
+ private event TestEventHandler PrivateEvent;
+
+ public static void FireStatic(TestEventArgs e) {
+ if (PublicStaticEvent != null) {
+ PublicStaticEvent(null, e);
+ }
+ }
+
+ public void FireEvent(TestEventArgs e) {
+ if (PublicEvent != null) {
+ PublicEvent(this, e);
+ }
+ }
+
+ public void ShutUpCompiler() {
+ // This is just to quiet compiler warnings about events never
+ // being used - they are used from the Python unit tests.
+ ProtectedStaticEvent = null;
+ InternalStaticEvent = null;
+ PrivateStaticEvent = null;
+ ProtectedEvent = null;
+ InternalEvent = null;
+ PrivateEvent = null;
+ }
+ }
+
+
+ public class TestEventArgs : EventArgs {
+ public int value;
+
+ public TestEventArgs(int v) {
+ this.value = v;
+ }
}
+
}
More information about the Zope-CVS
mailing list