diff options
author | jfrijters <jfrijters> | 2011-03-08 08:49:01 +0300 |
---|---|---|
committer | jfrijters <jfrijters> | 2011-03-08 08:49:01 +0300 |
commit | 33207c51dd5f8625ad5b030005b85defdb514e85 (patch) | |
tree | 786ce2e912904dc7d91efb62d4ecffe6f59ba773 /reflect/Emit | |
parent | d2d79ab03c985a1b29358032e66d6d7d7e31eaf8 (diff) |
Added API extensions to get and add referenced modules.
Diffstat (limited to 'reflect/Emit')
-rw-r--r-- | reflect/Emit/AssemblyBuilder.cs | 5 | ||||
-rw-r--r-- | reflect/Emit/ModuleBuilder.cs | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/reflect/Emit/AssemblyBuilder.cs b/reflect/Emit/AssemblyBuilder.cs index 36a8d6a0..a56a2d42 100644 --- a/reflect/Emit/AssemblyBuilder.cs +++ b/reflect/Emit/AssemblyBuilder.cs @@ -726,6 +726,11 @@ namespace IKVM.Reflection.Emit throw new InvalidOperationException(); } + public override string[] __GetReferencedModules() + { + throw new InvalidOperationException(); + } + internal override Type GetModuleType() { throw new InvalidOperationException(); diff --git a/reflect/Emit/ModuleBuilder.cs b/reflect/Emit/ModuleBuilder.cs index 333b24f9..89ab9c75 100644 --- a/reflect/Emit/ModuleBuilder.cs +++ b/reflect/Emit/ModuleBuilder.cs @@ -1276,6 +1276,21 @@ namespace IKVM.Reflection.Emit } return list.ToArray(); } + + public void __AddModuleReference(string module) + { + this.ModuleRef.FindOrAddRecord(this.Strings.Add(module)); + } + + public override string[] __GetReferencedModules() + { + string[] arr = new string[this.ModuleRef.RowCount]; + for (int i = 0; i < arr.Length; i++) + { + arr[i] = this.Strings.Find(this.ModuleRef.records[i]); + } + return arr; + } } class ArrayMethod : MethodInfo |