Author: juraj
Date: 2007-07-19 11:56:49 -0400 (Thu, 19 Jul 2007)
New Revision: 82295

Modified:
   trunk/mcs/class/System/System.IO/ChangeLog
   trunk/mcs/class/System/System.IO/FileSystemWatcher.cs
Log:
2007-07-19  Juraj Skripsky  <[EMAIL PROTECTED]>

        * FileSystemWatcher.ch (RaiseEvent): Invoke delegate directly, we don't
        need the extra control provided by using GetInvocationList().




Modified: trunk/mcs/class/System/System.IO/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.IO/ChangeLog  2007-07-19 15:42:53 UTC (rev 
82294)
+++ trunk/mcs/class/System/System.IO/ChangeLog  2007-07-19 15:56:49 UTC (rev 
82295)
@@ -1,3 +1,8 @@
+2007-07-19  Juraj Skripsky  <[EMAIL PROTECTED]>
+
+       * FileSystemWatcher.ch (RaiseEvent): Invoke delegate directly, we don't
+       need the extra control provided by using GetInvocationList().
+
 2006-11-01  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * ErrorEventHandler.cs: Remove [Serializable] in NET_2_0.

Modified: trunk/mcs/class/System/System.IO/FileSystemWatcher.cs
===================================================================
--- trunk/mcs/class/System/System.IO/FileSystemWatcher.cs       2007-07-19 
15:42:53 UTC (rev 82294)
+++ trunk/mcs/class/System/System.IO/FileSystemWatcher.cs       2007-07-19 
15:56:49 UTC (rev 82295)
@@ -371,19 +371,16 @@
                                return;
 
                        if (synchronizingObject == null) {
-                               Delegate [] delegates = ev.GetInvocationList ();
-                               if (evtype == EventType.RenameEvent) {
-                                       foreach (RenamedEventHandler d in 
delegates){
-                                               d.BeginInvoke (this, 
(RenamedEventArgs) arg, null, null);
-                                       }
-                               } else if (evtype == EventType.ErrorEvent) {
-                                       foreach (ErrorEventHandler d in 
delegates){
-                                               d.BeginInvoke (this, 
(ErrorEventArgs) arg, null, null);
-                                       }
-                               } else {
-                                       foreach (FileSystemEventHandler d in 
delegates){
-                                               d.BeginInvoke (this, 
(FileSystemEventArgs) arg, null, null);
-                                       }
+                               switch (evtype) {
+                               case EventType.RenameEvent:
+                                       ((RenamedEventHandler)ev).BeginInvoke 
(this, (RenamedEventArgs) arg, null, null);
+                                       break;
+                               case EventType.ErrorEvent:
+                                       ((ErrorEventHandler)ev).BeginInvoke 
(this, (ErrorEventArgs) arg, null, null);
+                                       break;
+                               case EventType.FileSystemEvent:
+                                       
((FileSystemEventHandler)ev).BeginInvoke (this, (FileSystemEventArgs) arg, 
null, null);
+                                       break;
                                }
                                return;
                        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to