Dnia roda, 8 czerwca 2005 22:40, Martin Baulig napisa:
Hello,
I'll commit it tomorrow morning.
Don't worry, we're waiting with the release to get a few more of my
fixes in, so this'll definitely go in :-)
Sorry you had problems merging this patch. It was created against 45614.
Seems like Zoltan was faster in adding some of the similar API:
http://galactus.ximian.com/pipermail/mono-patches/2005-June/059635.html
in 45626
I'm attaching the new patch, against 45700. Hope the will be no more problems
(there are still some more 2.0 API additions there, so more conflicts are
possible).
--
Kamil Skalski
http://nazgul.omega.pl
Index: class/corlib/System/Type.cs
===
--- class/corlib/System/Type.cs (wersja 45700)
+++ class/corlib/System/Type.cs (kopia robocza)
@@ -760,6 +760,22 @@
return GetMethodImpl (name, bindingAttr, binder, callConvention, types, modifiers);
}
+ internal virtual MethodInfo GetMethod (MethodInfo fromNoninstanciated)
+{
+ throw new System.InvalidOperationException (can only be called in generic type);
+}
+
+ internal virtual ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
+{
+ throw new System.InvalidOperationException (can only be called in generic type);
+}
+
+ internal virtual FieldInfo GetField (FieldInfo fromNoninstanciated)
+{
+ throw new System.InvalidOperationException (can only be called in generic type);
+}
+
+
public MethodInfo[] GetMethods ()
{
return GetMethods (DefaultBindingFlags);
@@ -1110,6 +1126,11 @@
return res;
}
+public Type MakeGenericType (Type[] types)
+{
+ return BindGenericParameters (types);
+}
+
public abstract bool IsGenericParameter {
get;
}
Index: class/corlib/System/ChangeLog
===
--- class/corlib/System/ChangeLog (wersja 45700)
+++ class/corlib/System/ChangeLog (kopia robocza)
@@ -1,3 +1,9 @@
+2005-06-09 Kamil Skalski [EMAIL PROTECTED]
+ * Type.cs: Add MakeGenericType method form .NET 2.0 beta 2 API
+
+ * Type.cs MonoType.cs: Add internal virtual Get{Method,Constructor,Field}
+ for obtaining instanciated *Info objects from non-instanciated counterparts
+
2005-06-09 Zoltan Varga [EMAIL PROTECTED]
* ModuleHandle RuntimeMethodHandle.cs RuntimeTypeHandle.cs RuntimeFieldHandle.cs RuntimeArgumentHandle.cs: Add missing 2.0 attributes.
Index: class/corlib/System/MonoType.cs
===
--- class/corlib/System/MonoType.cs (wersja 45700)
+++ class/corlib/System/MonoType.cs (kopia robocza)
@@ -224,6 +224,31 @@
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern MethodInfo GetCorrespondingInflatedMethod (IntPtr generic);
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern ConstructorInfo GetCorrespondingInflatedConstructor (IntPtr generic);
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern FieldInfo GetCorrespondingInflatedField (IntPtr generic);
+
+
+ internal override MethodInfo GetMethod (MethodInfo fromNoninstanciated)
+{
+return GetCorrespondingInflatedMethod (fromNoninstanciated.MethodHandle.Value);
+}
+
+ internal override ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
+ {
+return GetCorrespondingInflatedConstructor (fromNoninstanciated.MethodHandle.Value);
+ }
+
+ internal override FieldInfo GetField (FieldInfo fromNoninstanciated)
+ {
+return GetCorrespondingInflatedField (fromNoninstanciated.FieldHandle.Value);
+ }
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern override Type GetNestedType (string name, BindingFlags bindingAttr);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
Index: class/corlib/System.Reflection.Emit/FieldBuilder.cs
===
--- class/corlib/System.Reflection.Emit/FieldBuilder.cs (wersja 45700)
+++ class/corlib/System.Reflection.Emit/FieldBuilder.cs (kopia robocza)
@@ -80,7 +80,7 @@
public override RuntimeFieldHandle FieldHandle {
get {
-throw CreateNotSupportedException ();
+return handle;
}
}
Index: class/corlib/System.Reflection.Emit/ChangeLog
===
--- class/corlib/System.Reflection.Emit/ChangeLog (wersja 45700)
+++ class/corlib/System.Reflection.Emit/ChangeLog (kopia robocza)
@@ -1,3 +1,11 @@
+2005-06-09 Kamil Skalski [EMAIL PROTECTED]
+ * ConstructorBuilder.cs FieldBuilders.cs MethodBuilder.cs: Return
+ RuntimeHandles when requested
+
+ * TypeBuilder.cs: Add static Get{Method,Constructor,Field} methods
+ from .NET 2.0 beta 2 API for obtaining instanciated