Beispiel #1
0
        public override IPermission Copy()
        {
            CustomPermission copy = new CustomPermission(PermissionState.None);

            if (this.IsUnrestricted())
            {
                copy.unrestricted = true;
            }
            else
            {
                copy.unrestricted = false;
            }
            return(copy);
        }
Beispiel #2
0
        public override IPermission Copy()
        {
            CustomPermission copy = new CustomPermission(PermissionState.None);

            if (this.IsUnrestricted())
            {
                copy.unrestricted = true;
            }
            else
            {
                copy.unrestricted = false;
            }
            return copy;
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
 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);
     }
 }