[corlib] Fixed StringBuilder construction bugs in marshalling caused by changes to...
[mono.git] / mcs / class / corlib / System.Diagnostics / DebuggerDisplayAttribute.cs
index ae4eb7fc9979a85ea0190b205fbd11216d6f8f47..c0ea829f122b4a1db623a1a25e9b73428af75720 100644 (file)
@@ -29,6 +29,7 @@
 //
 
 using System;
+using System.Runtime.InteropServices;
 
 namespace System.Diagnostics {
 
@@ -39,18 +40,20 @@ namespace System.Diagnostics {
                                 AttributeTargets.Delegate |
                                 AttributeTargets.Property |
                                 AttributeTargets.Assembly, AllowMultiple=true)]        
-#if NET_2_0
+       [ComVisible (true)]
        public sealed class DebuggerDisplayAttribute : Attribute
-#else
-       internal sealed class DebuggerDisplayAttribute : Attribute
-#endif
        {
                string value, type, name;
                string target_type_name;
                Type target_type;
 
                public DebuggerDisplayAttribute (string value) {
+                       if (value == null)
+                               value = string.Empty;
+
                        this.value = value;
+                       this.type = string.Empty;
+                       this.name = string.Empty;
                }
 
                public string Value {
@@ -64,8 +67,11 @@ namespace System.Diagnostics {
                                return target_type;
                        }
                        set {
+                               if (value == null)
+                                       throw new ArgumentNullException ("value");
+
                                target_type = value;
-                               target_type_name = target_type.Name;
+                               target_type_name = target_type.AssemblyQualifiedName;
                        }
                }
 
@@ -94,7 +100,7 @@ namespace System.Diagnostics {
                        }
 
                        set {
-                               type = name;
+                               name = value;
                        }
                }
        }