Switch to compiler-tester
[mono.git] / mcs / class / corlib / System.Reflection / CustomAttributeTypedArgument.cs
index ec0fd49bda218518e21440407f0a41395994ab79..b7ba8d476990bf78c8edbf2d0f6b69a10f5b77ac 100644 (file)
@@ -3,6 +3,7 @@
 //
 // Author:
 //   Zoltan Varga (vargaz@gmail.com)
+//   Carlos Alberto Cortez (calberto.cortez@gmail.com)
 //
 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
 //
@@ -33,24 +34,40 @@ using System.Runtime.InteropServices;
 
 namespace System.Reflection {
 
-#if NET_2_0
        [ComVisible (true)]
-#endif
+       [Serializable]
        public struct CustomAttributeTypedArgument {
+               Type argumentType;
+               object value;
+
+               internal CustomAttributeTypedArgument (Type argumentType, object value)
+               {
+                       this.argumentType = argumentType;
+                       this.value = value;
+               }
 
-               [MonoTODO]
                public Type ArgumentType {
                        get {
-                               throw new NotImplementedException ();
+                               return argumentType;
                        }
                }
 
-               [MonoTODO]
                public object Value {
                        get {
-                               throw new NotImplementedException ();
+                               return value;
                        }
                }
+
+               public override string ToString ()
+               {
+                       string val = value.ToString ();
+                       if (argumentType == typeof (string))
+                               return "\"" + val + "\"";
+                       if (argumentType == typeof (Type)) 
+                               return "typeof (" + val + ")";
+
+                       return val;
+               }
        }
 
 }