+ private struct SNIP {
+ public StrongNamePublicKeyBlob PublicKey;
+ public string Name;
+ public Version AssemblyVersion;
+
+ internal SNIP (StrongNamePublicKeyBlob pk, string name, Version version)
+ {
+ PublicKey = pk;
+ Name = name;
+ AssemblyVersion = version;
+ }
+
+ internal static SNIP CreateDefault ()
+ {
+ return new SNIP (null, String.Empty, (Version) defaultVersion.Clone ());
+ }
+
+ 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);
+ }
+
+ internal bool IsSubsetOf (SNIP target)
+ {
+ if ((PublicKey != null) && PublicKey.Equals (target.PublicKey))
+ return true;
+
+ if (!IsNameSubsetOf (target.Name))
+ return false;
+ if ((AssemblyVersion != null) && !AssemblyVersion.Equals (target.AssemblyVersion))
+ return false;
+ // in case PermissionState.None was used in the constructor
+ if (PublicKey == null)
+ return (target.PublicKey == null);
+ return false;
+ }
+ }
+
+#if NET_2_0
+ private PermissionState _state;
+ private ArrayList _list;
+