Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / ListItemCollection.cs
index 236092cfa8b4801298a560e72dbf7fa4cf43013a..b0d19ca082776497df4fe166e025b491ee4cc6b8 100644 (file)
@@ -36,13 +36,12 @@ namespace System.Web.UI.WebControls {
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        // attributes
        [Editor("System.Web.UI.Design.WebControls.ListItemsCollectionEditor, " + Consts.AssemblySystem_Design, typeof (System.Drawing.Design.UITypeEditor))]
-       public sealed class ListItemCollection : IList, ICollection, IEnumerable, IStateManager {
+       public sealed class ListItemCollection : IList, ICollection, IEnumerable, IStateManager 
+       {
 #region Fields
-               private ArrayList       items;
-               private bool            tracking;
-               private bool            dirty;
-               bool                    itemsEnabled;
-               
+               ArrayList items;
+               bool tracking;
+               bool dirty;
                int lastDirty = 0;
 #endregion     // Fields
 
@@ -52,11 +51,6 @@ namespace System.Web.UI.WebControls {
                }
 #endregion     // Public Constructors
 
-               internal bool ItemsEnabled {
-                       get { return itemsEnabled; }
-                       set { itemsEnabled = value; }
-               }
-               
 #region Public Instance Properties
                public int Capacity {
                        get {
@@ -278,20 +272,21 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-               void IStateManager.LoadViewState (object savedState) {
+               void IStateManager.LoadViewState (object savedState)
+               {
                        Pair pair = savedState as Pair;
                        if (pair == null)
                                return;
 
                        bool newCollection = (bool) pair.First;
                        object [] itemsArray = (object []) pair.Second;
-            int count = itemsArray==null ? 0 : itemsArray.Length;
+                       int count = itemsArray==null ? 0 : itemsArray.Length;
 
-            if (newCollection)
-                if (count > 0)
-                    items = new ArrayList(count);
-                else
-                    items = new ArrayList();
+                       if (newCollection)
+                               if (count > 0)
+                                       items = new ArrayList(count);
+                               else
+                                       items = new ArrayList();
 
                        for (int i = 0; i < count; i++) {
                                ListItem item = new ListItem ();
@@ -322,17 +317,8 @@ namespace System.Web.UI.WebControls {
                        object [] itemsState = null;
                        if (count > 0)
                                itemsState = new object [count];
-#if NET_2_0
-                       ListItem li;
-                       bool enabled = ItemsEnabled;
-#endif
+
                        for (int i = 0; i < count; i++) {
-#if NET_2_0
-                               li = items [i] as ListItem;
-                               if (li != null && li.Enabled != enabled)
-                                       li.Enabled = enabled;
-#endif
-                               
                                itemsState [i] = ((IStateManager) items [i]).SaveViewState ();
                                if (itemsState [i] != null)
                                        itemsDirty = true;
@@ -353,7 +339,7 @@ namespace System.Web.UI.WebControls {
                }
 #endregion     // Interface methods
 
-               private void SetDirty ()
+               void SetDirty ()
                {
                        dirty = true;
                        for (int i = lastDirty; i < items.Count; i++)