dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] pnetlib ./ChangeLog System.Windows.Forms/Contro...


From: Heiko Weiss
Subject: [dotgnu-pnet-commits] pnetlib ./ChangeLog System.Windows.Forms/Contro...
Date: Thu, 23 Mar 2006 10:11:34 +0000

CVSROOT:        /sources/dotgnu-pnet
Module name:    pnetlib
Branch:         
Changes by:     Heiko Weiss <address@hidden>    06/03/23 10:11:34

Modified files:
        .              : ChangeLog 
        System.Windows.Forms: Control.cs 

Log message:
        optimized dispose, changed ForceLayout

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/pnetlib/ChangeLog.diff?tr1=1.2373&tr2=1.2374&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/pnetlib/System.Windows.Forms/Control.cs.diff?tr1=1.114&tr2=1.115&r1=text&r2=text

Patches:
Index: pnetlib/ChangeLog
diff -u pnetlib/ChangeLog:1.2373 pnetlib/ChangeLog:1.2374
--- pnetlib/ChangeLog:1.2373    Tue Mar 21 10:40:01 2006
+++ pnetlib/ChangeLog   Thu Mar 23 10:11:34 2006
@@ -1,5 +1,9 @@
 2006-03-21  Heiko Weiss  <address@hidden>
 
+       * System.Windows.Forms/Control.cs: optimized dispose, changed 
ForceLayout
+
+2006-03-21  Heiko Weiss  <address@hidden>
+
        * System.Windows.Forms/Form.cs: CloseRequest, do nothing if Form was 
desposed
        * System.Windows.Forms/Control.cs: changed handling of setting Parent 
to null, or reparent the control.
        * System.Drawing.Xsharp/DrawingWindow.cs: fixed Dispose.
Index: pnetlib/System.Windows.Forms/Control.cs
diff -u pnetlib/System.Windows.Forms/Control.cs:1.114 
pnetlib/System.Windows.Forms/Control.cs:1.115
--- pnetlib/System.Windows.Forms/Control.cs:1.114       Tue Mar 21 10:40:01 2006
+++ pnetlib/System.Windows.Forms/Control.cs     Thu Mar 23 10:11:34 2006
@@ -1073,7 +1073,7 @@
                                                dockStyle = (byte)value;
                                                OnDockChanged(EventArgs.Empty);
                                                // Rethink our layout
-                                               PerformLayout();
+                                               PerformLayout(this,"Dock");
                                        }
                                }
                        }
@@ -2241,52 +2241,48 @@
        protected virtual void Dispose(bool disposing)
 #endif
                        {
+                               if( GetControlFlag(ControlFlags.Disposed) || 
GetControlFlag(ControlFlags.Disposing) ) {
+                                       return;// do nothing if already 
disposing or disposed
+                               }
+                               
                                try
                                {
                                        SetControlFlag(ControlFlags.Disposing, 
true);
                                        try
                                        {
-                                               if(buffer != null)
-                                               {
-                                                       buffer.Dispose();
-                                                       buffer = null;
-                                               }
-                                       }
-                                       finally
-                                       {
-                                               try
-                                               {
+                                               if( toolkitWindow != null ) { 
// prevent one method call for performance
                                                        DestroyHandle();
+                                               }
                                                
-                                                       // Remove this control 
from Parent
-                                                       if( null != this.parent 
) {
-                                                               
this.parent.Controls.Remove(this);
-                                                       }
-                                                       
-                                                       // Dispose all childs
-                                                       if( null != 
controlCollection ) {
-                                                               Control o;
-                                                               for( int i = 0; 
i < controlCollection.Count; i++ ) {
-                                                                       o = 
controlCollection[i];
-                                                                       
o.parent = null;
-                                                                       
o.Dispose();
-                                                                       o = 
null;
-                                                               }
-                                                               
controlCollection = null;
-                                                       }
+                                               // Remove this control from 
Parent
+                                               if( null != this.parent ) {
+                                                       
this.parent.Controls.Remove(this);
                                                }
-                                               finally
-                                               {
-                                                       
SetControlFlag(ControlFlags.Disposed, true);
+                                               
+                                               // Dispose all childs
+                                               if( null != controlCollection ) 
{
+                                                       Control o;
+                                                       int iCount = 
controlCollection.Count;
+                                                       for( int i = 0; i < 
iCount; i++ ) {
+                                                               o = 
controlCollection[i];
+                                                               o.parent = null;
+                                                               o.Dispose();
+                                                               o = null;
+                                                       }
+                                                       controlCollection = 
null;
                                                }
                                        }
+                                       finally
+                                       {
+                                               
SetControlFlag(ControlFlags.Disposed, true);
+                                       }
                                }
                                finally
                                {
                                        SetControlFlag(ControlFlags.Disposing, 
false);
                                }
 #if CONFIG_COMPONENT_MODEL
-                               base.Dispose(disposing);
+                               // not needed in this implementation 
base.Dispose(disposing);
 #endif
                        }
 
@@ -3467,7 +3463,7 @@
 
                                // Update the bounds and emit the necessary 
events.
                                UpdateBounds(x, y, width, height);
-                               }
+                       }
 
        // Adjust the actual position of the control depending on windows 
decorations (Draw Origin) or non client areas (client origin) like menus.
        private void SetBoundsToolkit(int x, int y, int width, int height)
@@ -5478,7 +5474,7 @@
        // Make sure that the control lays itself out and all its children.
        private void ForceLayout()
                        {
-                               PerformLayout();
+                               PerformLayout(this,null);
                                for(int posn = (numChildren - 1); posn >= 0; 
--posn)
                                {
                                        children[posn].ForceLayout();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]