using System.Globalization;
namespace System.Reflection.Emit {
-#if NET_2_0
[ComVisible (true)]
[ComDefaultInterface (typeof (_ModuleBuilder))]
-#endif
[ClassInterface (ClassInterfaceType.None)]
public class ModuleBuilder : Module, _ModuleBuilder {
}
if (emitSymbolInfo) {
+#if NET_2_1 && !MONOTOUCH
+ 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");
throw new ExecutionEngineException ("The type that implements the default symbol writer interface cannot be found");
symbolWriter = (ISymbolWriter) Activator.CreateInstance (t, new object[] { this });
+#endif
string fileName = fqname;
if (assemblyb.AssemblyDir != null)
fileName = Path.Combine (assemblyb.AssemblyDir, fileName);
return DefineGlobalMethod (name, attributes, callingConvention, returnType, null, null, parameterTypes, null, null);
}
-#if NET_2_0 || BOOTSTRAP_NET_2_0
- public
-#else
- internal
-#endif
- MethodBuilder DefineGlobalMethod (string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)
+ public MethodBuilder DefineGlobalMethod (string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)
{
if (name == null)
throw new ArgumentNullException ("name");
return (TypeBuilder) name_cache [name];
}
-#if NET_2_0
[ComVisible (true)]
-#endif
public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, Type[] interfaces) {
return DefineType (name, attr, parent, interfaces, PackingSize.Unspecified, TypeBuilder.UnspecifiedTypeSize);
}
return eb;
}
-#if NET_2_0
[ComVisible (true)]
-#endif
public override Type GetType( string className) {
return GetType (className, false, false);
}
-#if NET_2_0
[ComVisible (true)]
-#endif
public override Type GetType( string className, bool ignoreCase) {
return GetType (className, false, ignoreCase);
}
return null;
}
-#if NET_2_0
[ComVisible (true)]
-#endif
- public override Type GetType (string className, bool throwOnError, bool ignoreCase) {
+ public override Type GetType (string className, bool throwOnError, bool ignoreCase)
+ {
+ if (className == null)
+ throw new ArgumentNullException ("className");
+ if (className.Length == 0)
+ throw new ArgumentException ("className");
+
int subt;
string orig = className;
string modifiers;
}
}
-#if NET_2_0
[ComVisible (true)]
-#endif
public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
}
throw new NotImplementedException ();
}
-#if NET_2_0 || BOOTSTRAP_NET_2_0
public void DefineManifestResource (string name, Stream stream, ResourceAttributes attribute) {
if (name == null)
throw new ArgumentNullException ("name");
resources [p].attrs = attribute;
resources [p].stream = stream;
}
-#endif
[MonoTODO]
public void SetSymCustomAttribute (string name, byte[] data)
return GetMethodToken (GetArrayMethod (arrayClass, methodName, callingConvention, returnType, parameterTypes));
}
-#if NET_2_0
[ComVisible (true)]
-#endif
public MethodToken GetConstructorToken (ConstructorInfo con)
{
if (con == null)