Merge pull request #350 from robwilkens/bug1089
[mono.git] / mcs / class / corlib / System / Nullable.cs
index 5ebdbf4b23dc62df6848c5589815f0718dc5d349..0d9d5928690bdb5ea239e6d901a134733ade3730 100644 (file)
@@ -34,6 +34,7 @@ using System.Reflection;
 using System.Collections.Generic;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
+using System.Diagnostics;
 
 namespace System
 {
@@ -81,10 +82,14 @@ namespace System
        }
 
        [Serializable]
+       [DebuggerDisplay ("{DebuggerDisplay}")]
+       [DebuggerStepThrough]
        public struct Nullable<T> where T: struct
        {
                #region Sync with runtime code
+               [DebuggerBrowsable (DebuggerBrowsableState.Never)]
                internal T value;
+               [DebuggerBrowsable (DebuggerBrowsableState.Never)]
                internal bool has_value;
                #endregion
 
@@ -94,10 +99,19 @@ namespace System
                        this.value = value;
                }
 
+               [DebuggerBrowsable (DebuggerBrowsableState.Never)]
+               string DebuggerDisplay {
+                       get {
+                               return has_value ? value.ToString () : null;
+                       }
+               }
+
+               [DebuggerBrowsable (DebuggerBrowsableState.Never)]
                public bool HasValue {
                        get { return has_value; }
                }
 
+               [DebuggerBrowsable (DebuggerBrowsableState.Never)]
                public T Value {
                        get { 
                                if (!has_value)