Author: martin
Date: 2005-06-22 10:35:53 -0400 (Wed, 22 Jun 2005)
New Revision: 46366

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/reflection.c
Log:
2005-06-22  Martin Baulig  <[EMAIL PROTECTED]>

        * reflection.c (type_get_qualified_name): Use
        mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
        (_mono_reflection_get_type_from_info): Added `MonoImage *image'
        argument; use it if we don't have an assembly name.



Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2005-06-22 14:34:17 UTC (rev 46365)
+++ trunk/mono/mono/metadata/ChangeLog  2005-06-22 14:35:53 UTC (rev 46366)
@@ -1,3 +1,10 @@
+2005-06-22  Martin Baulig  <[EMAIL PROTECTED]>
+
+       * reflection.c (type_get_qualified_name): Use
+       mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
+       (_mono_reflection_get_type_from_info): Added `MonoImage *image'
+       argument; use it if we don't have an assembly name.
+
 2005-06-22  Lluis Sanchez Gual  <[EMAIL PROTECTED]>
 
        * object.c: In mono_message_init, set "copy out" flag for in

Modified: trunk/mono/mono/metadata/reflection.c
===================================================================
--- trunk/mono/mono/metadata/reflection.c       2005-06-22 14:34:17 UTC (rev 
46365)
+++ trunk/mono/mono/metadata/reflection.c       2005-06-22 14:35:53 UTC (rev 
46366)
@@ -1467,12 +1467,12 @@
 
        klass = my_mono_class_from_mono_type (type);
        if (!klass) 
-               return mono_type_get_name (type);
+               return mono_type_get_name_full (type, 
MONO_TYPE_NAME_FORMAT_REFLECTION);
        ta = klass->image->assembly;
-       if (ta == ass || klass->image == mono_defaults.corlib)
-               return mono_type_get_name (type);
+       if (ta->dynamic || (ta == ass))
+               return mono_type_get_name_full (type, 
MONO_TYPE_NAME_FORMAT_REFLECTION);
 
-       return type_get_fully_qualified_name (type);
+       return mono_type_get_name_full (type, 
MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED);
 }
 
 static guint32
@@ -6138,10 +6138,9 @@
 }
 
 static MonoType*
-_mono_reflection_get_type_from_info (MonoTypeNameParse *info, gboolean 
ignorecase)
+_mono_reflection_get_type_from_info (MonoTypeNameParse *info, MonoImage 
*image, gboolean ignorecase)
 {
        gboolean type_resolve = FALSE;
-       MonoImage *image;
        MonoType *type;
 
        if (info->assembly.name) {
@@ -6153,7 +6152,7 @@
                                return NULL;
                }
                image = assembly->image;
-       } else {
+       } else if (!image) {
                image = mono_defaults.corlib;
        }
 
@@ -6216,7 +6215,7 @@
                for (i = 0; i < info->type_arguments->len; i++) {
                        MonoTypeNameParse *subinfo = g_ptr_array_index 
(info->type_arguments, i);
 
-                       type_args [i] = _mono_reflection_get_type_from_info 
(subinfo, ignorecase);
+                       type_args [i] = _mono_reflection_get_type_from_info 
(subinfo, image, ignorecase);
                        if (!type_args [i]) {
                                g_free (type_args);
                                return NULL;
@@ -6367,7 +6366,7 @@
        
        /*g_print ("requested type %s\n", str);*/
        if (mono_reflection_parse_type (tmp, &info)) {
-               type = _mono_reflection_get_type_from_info (&info, FALSE);
+               type = _mono_reflection_get_type_from_info (&info, image, 
FALSE);
        }
 
        g_free (tmp);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to