コード例 #1
0
        public override IPermission Union(IPermission target)
        {
            PrintingPermission pp = Cast(target);

            if (pp == null)
            {
                return(new PrintingPermission(_Level));
            }
            if (IsUnrestricted() || pp.IsUnrestricted())
            {
                return(new PrintingPermission(PermissionState.Unrestricted));
            }
            if (IsEmpty() && pp.IsEmpty())
            {
                return(null);
            }

            PrintingPermissionLevel level = (_Level > pp.Level) ? _Level : pp.Level;

            return(new PrintingPermission(level));
        }