this.owner = owner;
}
- public int Count {
+ public
+#if NET_2_0
+ virtual
+#endif
+ int Count {
get { return count; }
}
public virtual void Add (Control child)
{
if (child == null)
- throw new ArgumentNullException ();
+ throw new ArgumentNullException ("child");
if (readOnly)
throw new HttpException (Locale.GetText ("Collection is read-only."));
return (controls != null && Array.IndexOf (controls, c) != -1);
}
- public void CopyTo (Array array, int index)
+ public
+#if NET_2_0
+ virtual
+#endif
+ void CopyTo (Array array, int index)
{
if (controls == null)
return;
throw new ArgumentOutOfRangeException ("index", Locale.GetText ("Value has to be >= 0."));
for (int i=0; i < count; i++)
- array.SetValue (controls [i], i);
+ array.SetValue (controls [i], i + index);
}
- public IEnumerator GetEnumerator ()
+ public
+#if NET_2_0
+ virtual
+#endif
+ IEnumerator GetEnumerator ()
{
return new SimpleEnumerator (this);
}
public virtual int IndexOf (Control c)
{
- if (controls == null)
+ if (controls == null || c == null)
return -1;
return Array.IndexOf (controls, c);