2005-06-06 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Mon, 6 Jun 2005 18:08:49 +0000 (18:08 -0000)
committerZoltan Varga <vargaz@gmail.com>
Mon, 6 Jun 2005 18:08:49 +0000 (18:08 -0000)
* Type.cs MonoCustomAttrs.cs: Return SerializableAttribute for types as well.

svn path=/trunk/mcs/; revision=45512

mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/MonoCustomAttrs.cs
mcs/class/corlib/System/Type.cs

index fd7a3a8fdf857ec1c74e4141e39a8ae5412c2b53..b60ffc8d884dc5492ffba59c913f5b0eaf20f543 100644 (file)
@@ -1,3 +1,7 @@
+2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
+
+       * Type.cs MonoCustomAttrs.cs: Return SerializableAttribute for types as well.
+
 2005-06-06  Sebastien Pouliot  <sebastien@ximian.com>
 
        * Exception.cs: Implements _Exception only for 2.0.
index d5d75a08b279027050191e92a9e5abc730f296e8..bf375010b8242473e0204c47d687aea721bc96ab 100644 (file)
@@ -57,6 +57,8 @@ namespace System
                                pseudoAttrs = ((FieldInfo)obj).GetPseudoCustomAttributes ();
                        else if (obj is ParameterInfo)
                                pseudoAttrs = ((ParameterInfo)obj).GetPseudoCustomAttributes ();
+                       else if (obj is Type)
+                               pseudoAttrs = ((Type)obj).GetPseudoCustomAttributes ();
 
                        if (pseudoAttrs != null) {
                                object[] res = new object [attrs.Length + pseudoAttrs.Length];
index da18e7edee91c37a86f440ed7463241f9f101092..e2e4ea0504b48eaf4aa3c62a5b951bb8d5849caf 100644 (file)
@@ -1185,6 +1185,24 @@ namespace System {
                                return attr;
                        }
                }
+
+               internal object[] GetPseudoCustomAttributes () {
+                       int count = 0;
+
+                       if (IsSerializable)
+                               count ++;
+
+                       if (count == 0)
+                               return null;
+                       object[] attrs = new object [count];
+                       count = 0;
+
+                       if (IsSerializable)
+                               attrs [count ++] = new SerializableAttribute ();
+
+                       return attrs;
+               }                       
+
 #endif
        }
 }