System.Net.DnsPermission.IsSubsetOf C# (CSharp) Method

IsSubsetOf() public method

public IsSubsetOf ( IPermission target ) : bool
target IPermission
return bool
        public override bool IsSubsetOf(IPermission target) {
            // Pattern suggested by Security engine
            if (target == null) {
                return m_noRestriction == false;
            }
            DnsPermission other = target as DnsPermission;
            if (other == null) {
                throw new ArgumentException(SR.GetString(SR.net_perm_target), "target");
            }
            //Here is the matrix of result based on m_noRestriction for me and she
            //    me.noRestriction      she.noRestriction   me.isSubsetOf(she)
            //                  0       0                   1
            //                  0       1                   1
            //                  1       0                   0
            //                  1       1                   1
            return (!m_noRestriction || other.m_noRestriction);
        }

Usage Example

		public void IsSubset_BadPermission ()
		{
			DnsPermission dp = new DnsPermission (PermissionState.None);
			dp.IsSubsetOf (new SecurityPermission (PermissionState.Unrestricted));
		}
All Usage Examples Of System.Net.DnsPermission::IsSubsetOf