From fe283242da53598bf632a55f436540e3e3340846 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Thu, 8 Dec 2005 08:17:29 +0000 Subject: [PATCH] 2005-12-08 Gonzalo Paniagua Javier * Control.cs: use _controls instead of the property wherever possible. svn path=/trunk/mcs/; revision=54099 --- mcs/class/System.Web/System.Web.UI/ChangeLog | 4 +++ mcs/class/System.Web/System.Web.UI/Control.cs | 36 ++++++++++--------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/mcs/class/System.Web/System.Web.UI/ChangeLog b/mcs/class/System.Web/System.Web.UI/ChangeLog index 5ce8ae0ab6098..69a8864e137f7 100644 --- a/mcs/class/System.Web/System.Web.UI/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI/ChangeLog @@ -1,3 +1,7 @@ +2005-12-08 Gonzalo Paniagua Javier + + * Control.cs: use _controls instead of the property wherever possible. + 2005-12-05 Gonzalo Paniagua Javier * Control.cs: use the _controls field instead of the Controls property. diff --git a/mcs/class/System.Web/System.Web.UI/Control.cs b/mcs/class/System.Web/System.Web.UI/Control.cs index cd7ab830d37f0..ab63b54221edc 100644 --- a/mcs/class/System.Web/System.Web.UI/Control.cs +++ b/mcs/class/System.Web/System.Web.UI/Control.cs @@ -437,8 +437,10 @@ void SetMask (int m, bool val) protected bool ChildControlsCreated { get { return ((stateMask & CHILD_CONTROLS_CREATED) != 0); } set { - if (value == false && (stateMask & CHILD_CONTROLS_CREATED) != 0) - Controls.Clear(); + if (value == false && (stateMask & CHILD_CONTROLS_CREATED) != 0) { + if (_controls != null) + _controls.Clear(); + } SetMask (CHILD_CONTROLS_CREATED, value); } @@ -538,7 +540,7 @@ void NullifyUniqueID () if (!HasControls ()) return; - foreach (Control c in Controls) + foreach (Control c in _controls) c.NullifyUniqueID (); } @@ -660,7 +662,7 @@ protected bool HasEvents () protected bool IsLiteralContent() { - if (HasControls () && Controls.Count == 1 && (Controls [0] is LiteralControl)) + if (HasControls () && _controls.Count == 1 && (_controls [0] is LiteralControl)) return true; return false; @@ -678,7 +680,7 @@ Control LookForControlByName (string id) return null; Control result = null; - foreach (Control c in Controls) { + foreach (Control c in _controls) { if (String.Compare (id, c._userId, true) == 0) { if (result != null && result != c) { throw new HttpException ("1 Found more than one control with ID '" + id + "'"); @@ -1046,9 +1048,9 @@ void DataBindChildren () if (!HasControls ()) return; - int len = Controls.Count; + int len = _controls.Count; for (int i = 0; i < len; i++) { - Control c = Controls [i]; + Control c = _controls [i]; c.DataBind (); } } @@ -1139,10 +1141,10 @@ internal void LoadRecursive() #endif OnLoad (EventArgs.Empty); if (HasControls ()) { - int len = Controls.Count; + int len = _controls.Count; for (int i=0;i