public IsSubsetOf ( IPermission target ) : bool | ||
target | IPermission | |
Résultat | bool |
public override bool IsSubsetOf(IPermission target) {
if (target == null) {
return _level == AspNetHostingPermissionLevel.None;
}
if (target.GetType() != typeof(AspNetHostingPermission)) {
throw new ArgumentException(SR.GetString(SR.InvalidArgument, target == null ? "null" : target.ToString(), "target"));
}
AspNetHostingPermission other = (AspNetHostingPermission) target;
return Level <= other.Level;
}
private void CommonTests (AspNetHostingPermission p) { Assert.IsNotNull (p.Copy (), "Copy"); SecurityElement se = p.ToXml (); Assert.IsNotNull (se, "ToXml"); p.FromXml (se); Assert.IsNotNull (p.Intersect (p), "Intersect"); Assert.IsTrue (p.IsSubsetOf (p), "IsSubsetOf"); Assert.IsNotNull (p.Union (p), "Union"); }