Skip to content

Commit

Permalink
2005-12-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
Browse files Browse the repository at this point in the history
	* Control.cs: use _controls instead of the property wherever possible.


svn path=/trunk/mcs/; revision=54099
  • Loading branch information
gonzalop committed Dec 8, 2005
1 parent 0b49651 commit fe28324
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
4 changes: 4 additions & 0 deletions mcs/class/System.Web/System.Web.UI/ChangeLog
@@ -1,3 +1,7 @@
2005-12-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* Control.cs: use _controls instead of the property wherever possible.

2005-12-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* Control.cs: use the _controls field instead of the Controls property.
Expand Down
36 changes: 19 additions & 17 deletions mcs/class/System.Web/System.Web.UI/Control.cs
Expand Up @@ -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);
}
Expand Down Expand Up @@ -538,7 +540,7 @@ void NullifyUniqueID ()
if (!HasControls ())
return;

foreach (Control c in Controls)
foreach (Control c in _controls)
c.NullifyUniqueID ();
}

Expand Down Expand Up @@ -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;
Expand All @@ -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 + "'");
Expand Down Expand Up @@ -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 ();
}
}
Expand Down Expand Up @@ -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<len;i++)
{
Control c = Controls[i];
Control c = _controls[i];
c.LoadRecursive ();
}
}
Expand All @@ -1165,10 +1167,10 @@ internal void UnloadRecursive(Boolean dispose)
}
#endif
if (HasControls ()) {
int len = Controls.Count;
int len = _controls.Count;
for (int i=0;i<len;i++)
{
Control c = Controls[i];
Control c = _controls[i];
c.UnloadRecursive (dispose);
}
}
Expand Down Expand Up @@ -1208,10 +1210,10 @@ internal void PreRenderRecursiveInternal()
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.PreRenderRecursiveInternal ();
}
#if MONO_TRACE
Expand Down Expand Up @@ -1242,10 +1244,10 @@ internal void InitRecursive(Control namingContainer)
namingContainer.AutoID)
namingContainer._userId = namingContainer.GetDefaultName () + "b";

int len = Controls.Count;
int len = _controls.Count;
for (int i=0;i<len;i++)
{
Control c = Controls[i];
Control c = _controls[i];
c._page = Page;
c._namingContainer = namingContainer;
if (namingContainer != null && c._userId == null && c.AutoID)
Expand Down Expand Up @@ -1290,10 +1292,10 @@ internal object SaveViewStateRecursive ()
int idx = -1;
if (HasControls ())
{
int len = Controls.Count;
int len = _controls.Count;
for (int i=0;i<len;i++)
{
Control ctrl = Controls[i];
Control ctrl = _controls[i];
object ctrlState = ctrl.SaveViewStateRecursive ();
idx++;
if (ctrlState == null)
Expand Down

0 comments on commit fe28324

Please sign in to comment.