diff options
author | jfrijters <jfrijters> | 2011-11-07 18:05:52 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2011-11-07 18:05:52 +0400 |
commit | fb8a2bc4775858dfaad8c799a9cb6e6456b432fe (patch) | |
tree | aa3d7b4f18c6cf27184d45254616712cc73e80d4 /reflect/Emit | |
parent | 904fc21575a37eaecb0ae7b2c5cb8dd6515454cf (diff) |
Implemented most of AssemblyName (except parsing) without dependency on System.Reflection.AssemblyName.
Diffstat (limited to 'reflect/Emit')
-rw-r--r-- | reflect/Emit/AssemblyBuilder.cs | 6 | ||||
-rw-r--r-- | reflect/Emit/ModuleBuilder.cs | 9 |
2 files changed, 4 insertions, 11 deletions
diff --git a/reflect/Emit/AssemblyBuilder.cs b/reflect/Emit/AssemblyBuilder.cs index f30295ff..b3d256a0 100644 --- a/reflect/Emit/AssemblyBuilder.cs +++ b/reflect/Emit/AssemblyBuilder.cs @@ -77,9 +77,9 @@ namespace IKVM.Reflection.Emit { this.name = name.Name; SetVersionHelper(name.Version); - if (name.CultureInfo != null && !string.IsNullOrEmpty(name.CultureInfo.Name)) + if (!string.IsNullOrEmpty(name.Culture)) { - this.culture = name.CultureInfo.Name; + this.culture = name.Culture; } this.flags = name.RawFlags; this.hashAlgorithm = name.HashAlgorithm; @@ -185,7 +185,7 @@ namespace IKVM.Reflection.Emit AssemblyName n = new AssemblyName(); n.Name = name; n.Version = new Version(majorVersion, minorVersion, buildVersion, revisionVersion); - n.Culture = culture; + n.Culture = culture ?? ""; n.HashAlgorithm = hashAlgorithm; n.RawFlags = flags; n.SetPublicKey(publicKey != null ? (byte[])publicKey.Clone() : Empty<byte>.Array); diff --git a/reflect/Emit/ModuleBuilder.cs b/reflect/Emit/ModuleBuilder.cs index c56fe19d..770612e4 100644 --- a/reflect/Emit/ModuleBuilder.cs +++ b/reflect/Emit/ModuleBuilder.cs @@ -745,14 +745,7 @@ namespace IKVM.Reflection.Emit } rec.PublicKeyOrToken = this.Blobs.Add(ByteBuffer.Wrap(publicKeyOrToken)); rec.Name = this.Strings.Add(name.Name); - if (name.CultureInfo != null) - { - rec.Culture = this.Strings.Add(name.CultureInfo.Name); - } - else - { - rec.Culture = 0; - } + rec.Culture = name.Culture == null ? 0 : this.Strings.Add(name.Culture); if (name.hash != null) { rec.HashValue = this.Blobs.Add(ByteBuffer.Wrap(name.hash)); |