[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
// attributes
[Editor ("System.Web.UI.Design.WebControls.RoleGroupCollectionEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
- public sealed class RoleGroupCollection : StateManagedCollection {
+ public sealed class RoleGroupCollection : CollectionBase {
public RoleGroupCollection ()
{
public void CopyTo (RoleGroup[] array, int index)
{
- base.CopyTo (array, index);
- }
-
- protected override object CreateKnownType (int index)
- {
- return new RoleGroup ();
+ if (array == null)
+ throw new ArgumentNullException ("array");
+ if (index < 0)
+ throw new ArgumentException (Locale.GetText ("Negative index."), "index");
+ if (this.Count <= array.Length - index)
+ throw new ArgumentException (Locale.GetText ("Destination isn't large enough to copy collection."), "array");
+
+ for (int i=0; i < Count; i++)
+ array [i + index] = this [i];
}
public RoleGroup GetMatchingRoleGroup (IPrincipal user)
public void Remove (RoleGroup group)
{
- ((IList) this).Remove (group);
+ // note: checks required or we'll throw more exceptions :(
+ if (group != null) {
+ if (Contains (group))
+ ((IList) this).Remove (group);
+ }
}
[MonoTODO]
public void OnValidate (object sender)
{
}
-
- [MonoTODO]
- protected override void SetDirtyObject (object o)
- {
- }
}
}