[Mono-bugs] [Bug 82523][Nor] New - events should be per-type, not per instance.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Aug 21 15:04:50 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by toshok at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=82523

--- shadow/82523	2007-08-21 15:04:50.000000000 -0400
+++ shadow/82523.tmp.4558	2007-08-21 15:04:50.000000000 -0400
@@ -0,0 +1,37 @@
+Bug#: 82523
+Product: Moonlight
+Version: 1_0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: engine
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: toshok at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: events should be per-type, not per instance.
+
+right now any type that has events defined on it registers the events in
+the ctor (and then maintains instance slots that contain the id for the
+event), for instance:
+
+class UIElement {
+...
+  int MouseLeftButtonDownEvent;
+}
+
+UIElement::UIElement ()
+{
+  MouseLeftButtonDownEvent = RegisterEvent ("MouseLeftButtonDown");
+}
+
+this is wasteful as the fields are allocated in every object when they're
+the same across all objects.  Also, the event registration (and the hash
+table mapping name to id) is also per object when all of it could be per type.
+
+Maybe we need a DependencyObject::RegisterEvent.


More information about the mono-bugs mailing list