-
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
//
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Collections;
[ComVisible (true)]
[ComDefaultInterface (typeof (_ModuleBuilder))]
[ClassInterface (ClassInterfaceType.None)]
+ [StructLayout (LayoutKind.Sequential)]
public class ModuleBuilder : Module, _ModuleBuilder {
#pragma warning disable 169, 414
}
if (emitSymbolInfo) {
-#if MOONLIGHT
- symbolWriter = new Mono.CompilerServices.SymbolWriter.SymbolWriterImpl (this);
-#else
Assembly asm = Assembly.LoadWithPartialName ("Mono.CompilerServices.SymbolWriter");
if (asm == null)
- throw new ExecutionEngineException ("The assembly for default symbol writer cannot be loaded");
-
- Type t = asm.GetType ("Mono.CompilerServices.SymbolWriter.SymbolWriterImpl");
- if (t == null)
- throw new ExecutionEngineException ("The type that implements the default symbol writer interface cannot be found");
+ throw new TypeLoadException ("The assembly for default symbol writer cannot be loaded");
+ Type t = asm.GetType ("Mono.CompilerServices.SymbolWriter.SymbolWriterImpl", true);
symbolWriter = (ISymbolWriter) Activator.CreateInstance (t, new object[] { this });
-#endif
string fileName = fqname;
if (assemblyb.AssemblyDir != null)
fileName = Path.Combine (assemblyb.AssemblyDir, fileName);
if (resourceFileName == String.Empty)
throw new ArgumentException ("resourceFileName");
if (!File.Exists (resourceFileName) || Directory.Exists (resourceFileName))
- throw new FileNotFoundException ("File '" + resourceFileName + "' does not exists or is a directory.");
+ throw new FileNotFoundException ("File '" + resourceFileName + "' does not exist or is a directory.");
throw new NotImplementedException ();
}
private static extern int getToken (ModuleBuilder mb, object obj, bool create_open_instance);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int getMethodToken (ModuleBuilder mb, MethodInfo method,
+ private static extern int getMethodToken (ModuleBuilder mb, MethodBase method,
Type[] opt_param_types);
internal int GetToken (string str)
return getToken (this, member, create_open_instance);
}
- internal int GetToken (MethodInfo method, Type[] opt_param_types) {
+ internal int GetToken (MethodBase method, Type[] opt_param_types) {
return getMethodToken (this, method, opt_param_types);
}
throw new NotImplementedException ();
}
-#if NET_4_0 || MOONLIGHT
+#if NET_4_0
public override Assembly Assembly {
get { return assemblyb; }
}
return Type.GetTypeFromHandle (new RuntimeTypeHandle (handle));
}
+ public override bool Equals (object obj)
+ {
+ return base.Equals (obj);
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ public override bool IsDefined (Type attributeType, bool inherit)
+ {
+ return base.IsDefined (attributeType, inherit);
+ }
+
+ public override object[] GetCustomAttributes (bool inherit)
+ {
+ return base.GetCustomAttributes (inherit);
+ }
+
+ public override object[] GetCustomAttributes (Type attributeType, bool inherit)
+ {
+ return base.GetCustomAttributes (attributeType, inherit);
+ }
+
+ public override FieldInfo GetField (string name, BindingFlags bindingAttr)
+ {
+ return base.GetField (name, bindingAttr);
+ }
+
+ public override FieldInfo[] GetFields (BindingFlags bindingFlags)
+ {
+ return base.GetFields (bindingFlags);
+ }
+
+ public override MethodInfo[] GetMethods (BindingFlags bindingFlags)
+ {
+ return base.GetMethods (bindingFlags);
+ }
+
+ public override int MetadataToken {
+ get {
+ return base.MetadataToken;
+ }
+ }
#endif
}
return mb.GetToken (member, create_open_instance);
}
- public int GetToken (MethodInfo method, Type[] opt_param_types) {
+ public int GetToken (MethodBase method, Type[] opt_param_types) {
return mb.GetToken (method, opt_param_types);
}
}
}
+#endif