This small patch improves ListView drawing performance by caching the control.LastVisibleIndex property. Very noticeable when working with 2 or 3 thousands items.

Regards,
Ernesto

Index: ThemeWin32Classic.cs
===================================================================
--- ThemeWin32Classic.cs        (revision 100451)
+++ ThemeWin32Classic.cs        (working copy)
@@ -2381,7 +2381,8 @@
                        bool details = control.View == View.Details;
                        int first = control.FirstVisibleIndex;  
 
-                       for (int i = first; i <= control.LastVisibleIndex; i 
++) {                                      
+                       int LastVisibleIndex = control.LastVisibleIndex;
+                       for (int i = first; i <= LastVisibleIndex; i ++) {      
                                
                                if (clip.IntersectsWith 
(control.Items[i].GetBounds (ItemBoundsPortion.Entire))) {
 #if NET_2_0
                                        bool owner_draw = false;
_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to