public override IPermission Union(IPermission target)
{
// LAMESPEC: according to spec we should throw an
// exception when target is null. We'll follow the
// behaviour of MS.Net instead of the spec, also
// because it matches the Intersect behaviour.
if (target == null)
{
return(null);
}
// throw new ArgumentNullException ("target");
WebPermission perm = target as WebPermission;
if (perm == null)
{
throw new ArgumentException("Argument not of type WebPermission");
}
if (this.m_noRestriction || perm.m_noRestriction)
{
return(new WebPermission(PermissionState.Unrestricted));
}
WebPermission copy = (WebPermission)perm.Copy();
copy.m_acceptList.InsertRange(copy.m_acceptList.Count, this.m_acceptList);
copy.m_connectList.InsertRange(copy.m_connectList.Count, this.m_connectList);
return(copy);
}