Author: mkestner
Date: 2007-03-29 13:11:51 -0500 (Thu, 29 Mar 2007)
New Revision: 75164

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ImageList.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
Log:

2007-03-29  Mike Kestner  <[EMAIL PROTECTED]>

        * ImageList.cs : add internal Changed event.
        * ListView.cs : hook up to StateImageList.Changed to perform
        invalidations when the the state icon list changes. [Fixes #81191]


Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-03-29 18:10:42 UTC (rev 75163)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-03-29 18:11:51 UTC (rev 75164)
@@ -1,3 +1,9 @@
+2007-03-29  Mike Kestner  <[EMAIL PROTECTED]>
+
+       * ImageList.cs : add internal Changed event.
+       * ListView.cs : hook up to StateImageList.Changed to perform
+       invalidations when the the state icon list changes. [Fixes #81191]
+
 2007-03-29  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * ToolTip.cs: Override the ToolTipWindow's ActivateOnShow property

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ImageList.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ImageList.cs     
2007-03-29 18:10:42 UTC (rev 75163)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ImageList.cs     
2007-03-29 18:11:51 UTC (rev 75164)
@@ -468,8 +468,13 @@
                                return itemIndex;
                        }
 
+                       internal event EventHandler Changed;
+
                        private int AddItemInternal(ImageListItem item)
                        {
+                               if (Changed != null)
+                                       Changed (this, EventArgs.Empty);
+
                                if (item.Image is Icon) {
                                        int imageWidth;
                                        int imageHeight;
@@ -851,6 +856,8 @@
 #if NET_2_0
                                keys.RemoveAt(index);
 #endif
+                               if (Changed != null)
+                                       Changed (this, EventArgs.Empty);
                        }
 
 #if NET_2_0

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2007-03-29 18:10:42 UTC (rev 75163)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2007-03-29 18:11:51 UTC (rev 75164)
@@ -661,11 +661,26 @@
                        }
                }
 
+               private void OnImageListChanged (object sender, EventArgs args)
+               {
+                       item_control.Invalidate ();
+               }
+
                [DefaultValue (null)]
                public ImageList StateImageList {
                        get { return state_image_list; }
                        set {
+                               if (state_image_list == value)
+                                       return;
+
+                               if (state_image_list != null)
+                                       state_image_list.Images.Changed -= new 
EventHandler (OnImageListChanged);
+
                                state_image_list = value;
+
+                               if (state_image_list != null)
+                                       state_image_list.Images.Changed += new 
EventHandler (OnImageListChanged);
+
                                this.Redraw (true);
                        }
                }

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

Reply via email to