diff options
author | jbevain <jbevain@gmail.com> | 2011-10-05 23:39:16 +0400 |
---|---|---|
committer | jbevain <jbevain@gmail.com> | 2011-10-05 23:39:16 +0400 |
commit | 1fe347b3f985d0a5f92f0b3127f3f5194c87a284 (patch) | |
tree | 86452d63007bcc643714d3d3cda6bacc822c0608 /Mono.Cecil | |
parent | 06279d0df861e347710d015408d153f9ad7ec264 (diff) |
Parse assembly name components indepently of the case. Fixes #77
Diffstat (limited to 'Mono.Cecil')
-rw-r--r-- | Mono.Cecil/AssemblyNameReference.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Mono.Cecil/AssemblyNameReference.cs b/Mono.Cecil/AssemblyNameReference.cs index c252c52..31b7a30 100644 --- a/Mono.Cecil/AssemblyNameReference.cs +++ b/Mono.Cecil/AssemblyNameReference.cs @@ -202,22 +202,22 @@ namespace Mono.Cecil { if (parts.Length != 2) throw new ArgumentException ("Malformed name"); - switch (parts [0]) { - case "Version": + switch (parts [0].ToLowerInvariant ()) { + case "version": name.Version = new Version (parts [1]); break; - case "Culture": + case "culture": name.Culture = parts [1]; break; - case "PublicKeyToken": - string pk_token = parts [1]; + case "publickeytoken": + var pk_token = parts [1]; if (pk_token == "null") break; name.PublicKeyToken = new byte [pk_token.Length / 2]; - for (int j = 0; j < name.PublicKeyToken.Length; j++) { + for (int j = 0; j < name.PublicKeyToken.Length; j++) name.PublicKeyToken [j] = Byte.Parse (pk_token.Substring (j * 2, 2), NumberStyles.HexNumber); - } + break; } } |