Quellcode durchsuchen

Updates and some implementation bits.

svn path=/trunk/mcs/; revision=1046
Paolo Molaro vor 24 Jahren
Ursprung
Commit
5bdd0bb7c7

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

@@ -9,6 +9,8 @@ using System.Runtime.CompilerServices;
 
 namespace System.Reflection.Emit {
 	public sealed class AssemblyBuilder : Assembly {
+		private IntPtr _impl;
+
 		public override string CodeBase {get {return null;}}
 		public override MethodInfo EntryPoint {get {return null;}}
 
@@ -167,7 +169,19 @@ namespace System.Reflection.Emit {
 		public override string ToString() {
 			return "AssemblyBuilder";
 		}
+		
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		private static extern int getDataChunk (AssemblyBuilder ab, int type, byte[] buf);
+
 		public void Save( string assemblyFileName) {
+			byte[] buf = new byte[4096];
+			FileStream file = new FileStream (assemblyFileName, FileMode.OpenOrCreate, FileAccess.Write);
+			int count;
+
+			count = getDataChunk (this, 0, buf);
+			file.Write (buf, 0, count);
+
+			file.Close ();
 		}
 		public void SetEntryPoint( MethodInfo entryMethod) {
 			

+ 7 - 8
mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs

@@ -4,16 +4,15 @@ using System.Runtime.CompilerServices;
 
 namespace System.Reflection.Emit {
 	public class ModuleBuilder : Module {
+		private IntPtr _impl;
 	
-	public override string FullyQualifiedName {get { return "FIXME: bah";}}
-
-	[MethodImplAttribute(MethodImplOptions.InternalCall)]
-	private static extern TypeBuilder defineType (ModuleBuilder mb, string name, TypeAttributes attr);
-	public TypeBuilder DefineType( string name, TypeAttributes attr) {
-		return defineType (this, name, attr);
-	}
-
+		public override string FullyQualifiedName {get { return "FIXME: bah";}}
 
+		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+		private static extern TypeBuilder defineType (ModuleBuilder mb, string name, TypeAttributes attr);
+		public TypeBuilder DefineType( string name, TypeAttributes attr) {
+			return defineType (this, name, attr);
+		}
 
 	}
 }

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

@@ -5,6 +5,7 @@ using System.Runtime.CompilerServices;
 
 namespace System.Reflection.Emit {
 	public sealed class TypeBuilder : Type {
+		private IntPtr _impl;
 
 	public const int UnspecifiedTypeSize = 1; // FIXME: check the real value
 		

+ 1 - 1
mcs/class/corlib/System.Reflection/AssemblyName.cs

@@ -3,7 +3,7 @@ using System.Reflection;
 
 namespace System.Reflection {
 	public class AssemblyName /* : ICloneable, ISerializable, IDeserializationCallback */ {
-		string name;
+		private string name;
 		
 		public virtual string Name {
 			get {return name;}

+ 25 - 0
mcs/class/corlib/System.Reflection/common.src

@@ -0,0 +1,25 @@
+Assembly.cs
+AssemblyNameFlags.cs
+BindingFlags.cs
+CallingConventions.cs
+ConstructorInfo.cs
+DefaultMemberAttribute.cs
+EventAttributes.cs
+EventInfo.cs
+FieldAttributes.cs
+FieldInfo.cs
+ICustomAttributeProvider.cs
+MemberFilter.cs
+MemberInfo.cs
+MemberTypes.cs
+MethodAttributes.cs
+MethodBase.cs
+MethodImplAttributes.cs
+MethodInfo.cs
+Module.cs
+ParameterAttributes.cs
+PropertyAttributes.cs
+PropertyInfo.cs
+ResourceAttributes.cs
+ResourceLocation.cs
+TypeAttributes.cs