[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
}
#endregion // Public Constructors
- internal bool ItemsEnabled {
- get { return itemsEnabled; }
- set { itemsEnabled = value; }
- }
-
#region Public Instance Properties
public int Capacity {
get {
}
}
- 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 ();
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;
}
#endregion // Interface methods
- private void SetDirty ()
+ void SetDirty ()
{
dirty = true;
for (int i = lastDirty; i < items.Count; i++)