public override IPermission Copy() { CustomPermission copy = new CustomPermission(PermissionState.None); if (this.IsUnrestricted()) { copy.unrestricted = true; } else { copy.unrestricted = false; } return(copy); }
public override IPermission Copy() { CustomPermission copy = new CustomPermission(PermissionState.None); if (this.IsUnrestricted()) { copy.unrestricted = true; } else { copy.unrestricted = false; } return copy; }
public override IPermission Intersect(IPermission target) { try { if (null == target) { return(null); } CustomPermission PassedPermission = (CustomPermission)target; if (!PassedPermission.IsUnrestricted()) { return(PassedPermission); } return(this.Copy()); } catch (InvalidCastException) { throw new ArgumentException("Argument_WrongType", this.GetType().FullName); } }
public override bool IsSubsetOf(IPermission target) { if (null == target) { return(!this.unrestricted); } try { CustomPermission passedpermission = (CustomPermission)target; if (this.unrestricted == passedpermission.unrestricted) { return(true); } else { return(false); } } catch (InvalidCastException) { throw new ArgumentException("Argument_WrongType", this.GetType().FullName); } }