System.Security.Permissions.StrongNameIdentityPermission.SNIP.IsNameSubsetOf C# (CSharp) Метод

IsNameSubsetOf() приватный Метод

private IsNameSubsetOf ( string target ) : bool
target string
Результат bool
			internal bool IsNameSubsetOf (string target) 
			{
				if (Name == null)
					return (target == null);
				if (target == null)
					return true;

				int wildcard = Name.LastIndexOf ('*');
				if (wildcard == 0)
					return true;		// *
				if (wildcard == -1)
					wildcard = Name.Length;	// exact match

				return (String.Compare (Name, 0, target, 0, wildcard, true, CultureInfo.InvariantCulture) == 0);
			}

Usage Example

 private bool Contains(StrongNameIdentityPermission.SNIP snip)
 {
     foreach (object obj in this._list)
     {
         StrongNameIdentityPermission.SNIP snip2 = (StrongNameIdentityPermission.SNIP)obj;
         bool flag  = (snip2.PublicKey == null && snip.PublicKey == null) || (snip2.PublicKey != null && snip2.PublicKey.Equals(snip.PublicKey));
         bool flag2 = snip2.IsNameSubsetOf(snip.Name);
         bool flag3 = (snip2.AssemblyVersion == null && snip.AssemblyVersion == null) || (snip2.AssemblyVersion != null && snip2.AssemblyVersion.Equals(snip.AssemblyVersion));
         if (flag && flag2 && flag3)
         {
             return(true);
         }
     }
     return(false);
 }