Browse Source

2005-06-07 Zoltan Varga <[email protected]>

	* *.cs: Updates for net 2.0 beta 2.

svn path=/trunk/mcs/; revision=45573
Zoltan Varga 20 years ago
parent
commit
cd7b342ad7

+ 8 - 0
mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs

@@ -81,6 +81,11 @@ namespace System.Reflection.Emit {
 		}
 	}
 
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_AssemblyBuilder))]
+#endif
 	public sealed class AssemblyBuilder : Assembly {
 		#region Sync with reflection.h
 		private IntPtr dynamic_assembly;
@@ -735,6 +740,9 @@ namespace System.Reflection.Emit {
 			}
 		}
 
+#if NET_2_0
+		[ComVisible (true)]
+#endif
 		public void SetCustomAttribute ( ConstructorInfo con, byte[] binaryAttribute) {
 			if (con == null)
 				throw new ArgumentNullException ("con");

+ 2 - 0
mcs/class/corlib/System.Reflection.Emit/ChangeLog

@@ -2,6 +2,8 @@
 
 	* *.cs: Updates for net 2.0 beta 2.
 
+	* *.cs: Updates for net 2.0 beta 2.
+
 2005-06-06  Zoltan Varga  <[email protected]>
 
 	* AssemblyBuilder.cs: Update after PortableExecutableKinds name change.

+ 9 - 0
mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs

@@ -41,6 +41,11 @@ using System.Diagnostics.SymbolStore;
 
 namespace System.Reflection.Emit {
 
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_ConstructorBuilder))]
+#endif
 	public sealed class ConstructorBuilder : ConstructorInfo {
 		private RuntimeMethodHandle mhandle;
 		private ILGenerator ilgen;
@@ -222,6 +227,10 @@ namespace System.Reflection.Emit {
 				cattrs [0] = customBuilder;
 			}
 		}
+
+#if NET_2_0
+		[ComVisible (true)]
+#endif
 		public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
 			if (con == null)
 				throw new ArgumentNullException ("con");

+ 5 - 0
mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs

@@ -38,6 +38,11 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_CustomAttributeBuilder))]
+#endif
 	public class CustomAttributeBuilder {
 		ConstructorInfo ctor;
 		byte[] data;

+ 3 - 0
mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs

@@ -42,6 +42,9 @@ using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
 
+#if NET_2_0
+	[ComVisible (true)]
+#endif
 	public sealed class DynamicMethod : MethodInfo {
 		#region Sync with reflection.h
 		private RuntimeMethodHandle mhandle;

+ 9 - 0
mcs/class/corlib/System.Reflection.Emit/EnumBuilder.cs

@@ -36,8 +36,14 @@ using System.Reflection;
 using System.Reflection.Emit;
 using System.Globalization;
 using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_EnumBuilder))]
+#endif
 	public sealed class EnumBuilder : Type {
 		private TypeBuilder _tb;
 		private FieldBuilder _underlyingField;
@@ -339,6 +345,9 @@ namespace System.Reflection.Emit {
 			_tb.SetCustomAttribute (customBuilder);
 		}
 
+#if NET_2_0
+		[ComVisible (true)]
+#endif
 		public void SetCustomAttribute (ConstructorInfo con, byte[] binaryAttribute)
 		{
 			SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));

+ 9 - 0
mcs/class/corlib/System.Reflection.Emit/EventBuilder.cs

@@ -39,6 +39,11 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_EventBuilder))]
+#endif
 	public sealed class EventBuilder {
 		string name;
 		Type type;
@@ -113,6 +118,10 @@ namespace System.Reflection.Emit {
 				cattrs [0] = customBuilder;
 			}
 		}
+
+#if NET_2_0
+		[ComVisible (true)]
+#endif
 		public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
 			if (con == null)
 				throw new ArgumentNullException ("con");

+ 8 - 0
mcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs

@@ -39,6 +39,11 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_FieldBuilder))]
+#endif
 	public sealed class FieldBuilder : FieldInfo {
 		private FieldAttributes attrs;
 		private Type type;
@@ -159,6 +164,9 @@ namespace System.Reflection.Emit {
 			}
 		}
 
+#if NET_2_0
+		[ComVisible (true)]
+#endif
 		public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
 			RejectIfCreated ();
 			SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));

+ 3 - 0
mcs/class/corlib/System.Reflection.Emit/GenericTypeParameterBuilder.cs

@@ -33,12 +33,14 @@ using System.Reflection;
 using System.Reflection.Emit;
 using System.Collections;
 using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
 using System.Globalization;
 using System.Runtime.Serialization;
 
 #if NET_2_0 || BOOTSTRAP_NET_2_0
 namespace System.Reflection.Emit
 {
+	[ComVisible (true)]
 	public sealed class GenericTypeParameterBuilder : Type
 	{
 	#region Sync with reflection.h
@@ -56,6 +58,7 @@ namespace System.Reflection.Emit
 			this.base_type = base_type_constraint;
 		}
 
+		[ComVisible (true)]
 		public void SetInterfaceConstraints (Type[] iface_constraints)
 		{
 			this.iface_constraints = iface_constraints;

+ 6 - 0
mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs

@@ -160,6 +160,11 @@ namespace System.Reflection.Emit {
 		int GetToken (SignatureHelper helper);
 	}		
 
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_ILGenerator))]
+#endif
 	public class ILGenerator: Object {
 		private struct LabelFixup {
 			public int offset;    // The number of bytes between pos and the
@@ -454,6 +459,7 @@ namespace System.Reflection.Emit {
 			code [code_len++] = val;
 		}
 		
+		[ComVisible (true)]
 		public virtual void Emit (OpCode opcode, ConstructorInfo constructor)
 		{
 			int token = token_gen.GetToken (constructor);

+ 6 - 0
mcs/class/corlib/System.Reflection.Emit/LocalBuilder.cs

@@ -38,9 +38,15 @@ using System.Reflection;
 using System.Reflection.Emit;
 using System.Globalization;
 using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
 using System.Diagnostics.SymbolStore;
 
 namespace System.Reflection.Emit {
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_LocalBuilder))]
+#endif
 #if NET_2_0
 	public sealed class LocalBuilder : LocalVariableInfo {
 #else

+ 9 - 1
mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs

@@ -41,7 +41,11 @@ using System.Runtime.InteropServices;
 using System.Diagnostics.SymbolStore;
 
 namespace System.Reflection.Emit {
-
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_MethodBuilder))]
+#endif
 	public sealed class MethodBuilder : MethodInfo {
 		private RuntimeMethodHandle mhandle;
 		private Type rtype;
@@ -358,6 +362,10 @@ namespace System.Reflection.Emit {
 				cattrs [0] = customBuilder;
 			}
 		}
+
+#if NET_2_0
+		[ComVisible (true)]
+#endif
 		public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
 			if (con == null)
 				throw new ArgumentNullException ("con");

+ 6 - 0
mcs/class/corlib/System.Reflection.Emit/MethodRental.cs

@@ -27,9 +27,15 @@
 //
 
 using System.Security.Permissions;
+using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit
 {
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_MethodRental))]
+#endif
 	public sealed class MethodRental {
 
 		public const int JitImmediate = 1;

+ 25 - 2
mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs

@@ -42,6 +42,11 @@ using System.Resources;
 using System.Globalization;
 
 namespace System.Reflection.Emit {
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_ModuleBuilder))]
+#endif
 	public class ModuleBuilder : Module {
 		#region Sync with reflection.h
 		private IntPtr dynamic_image;
@@ -257,6 +262,9 @@ namespace System.Reflection.Emit {
 			name_cache.Add (name, tb);
 		}
 
+#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);
 		}
@@ -288,10 +296,16 @@ namespace System.Reflection.Emit {
 			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);
 		}
@@ -339,7 +353,10 @@ namespace System.Reflection.Emit {
 			}
 			return null;
 		}
-		
+
+#if NET_2_0
+		[ComVisible (true)]
+#endif		
 		public override Type GetType (string className, bool throwOnError, bool ignoreCase) {
 			int subt;
 			string orig = className;
@@ -404,6 +421,10 @@ namespace System.Reflection.Emit {
 				cattrs [0] = customBuilder;
 			}
 		}
+
+#if NET_2_0
+		[ComVisible (true)]
+#endif
 		public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
 			SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
 		}
@@ -519,7 +540,9 @@ namespace System.Reflection.Emit {
 			return GetMethodToken (GetArrayMethod (arrayClass, methodName, callingConvention, returnType, parameterTypes));
 		}
 
-
+#if NET_2_0
+		[ComVisible (true)]
+#endif
 		public MethodToken GetConstructorToken (ConstructorInfo con)
 		{
 			if (con == null)

+ 5 - 0
mcs/class/corlib/System.Reflection.Emit/OpCodes.cs

@@ -1,4 +1,9 @@
+using System.Runtime.InteropServices;
+
 namespace System.Reflection.Emit {
+#if NET_2_0
+	[ComVisible (true)]
+#endif
 	public class OpCodes {
 		//
 		// The order is:

+ 9 - 0
mcs/class/corlib/System.Reflection.Emit/ParameterBuilder.cs

@@ -40,6 +40,11 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_ParameterBuilder))]
+#endif
 	public class ParameterBuilder {
 		private MethodBase methodb; /* MethodBuilder or ConstructorBuilder */
 		private string name;
@@ -113,6 +118,10 @@ namespace System.Reflection.Emit {
 				cattrs [0] = customBuilder;
 			}
 		}
+
+#if NET_2_0
+		[ComVisible (true)]
+#endif
 		public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
 			SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
 		}

+ 10 - 0
mcs/class/corlib/System.Reflection.Emit/PropertyBuilder.cs

@@ -36,8 +36,14 @@ using System.Reflection;
 using System.Reflection.Emit;
 using System.Globalization;
 using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_PropertyBuilder))]
+#endif
 	public sealed class PropertyBuilder : PropertyInfo {
 		private PropertyAttributes attrs;
 		private string name;
@@ -129,6 +135,10 @@ namespace System.Reflection.Emit {
 				cattrs [0] = customBuilder;
 			}
 		}
+
+#if NET_2_0
+		[ComVisible (true)]
+#endif
 		public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
 			SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
 		}

+ 5 - 1
mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs

@@ -39,7 +39,11 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
-
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_SignatureHelper))]
+#endif
 	public sealed class SignatureHelper {
 		internal enum SignatureHelperType {
 			HELPER_FIELD,

+ 5 - 1
mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs

@@ -43,7 +43,11 @@ using System.Security.Permissions;
 using System.Diagnostics.SymbolStore;
 
 namespace System.Reflection.Emit {
-
+#if NET_2_0
+	[ComVisible (true)]
+	[ClassInterfaceAttribute (ClassInterfaceType.None)]
+	[ComDefaultInterfaceAttribute (typeof (_TypeBuilder))]
+#endif
 	public sealed class TypeBuilder : Type {
 	#region Sync with reflection.h
 	private string tname;