views:

17

answers:

0

For some reason when the DebuggerDisplay attribute is used the debugger does not display the collection items. If I remove the attribute it works. I have also tried various versions of DebuggerDisplay string to see if it was my format.

Anyone know what the problem could be?

  <DebuggerTypeProxy(GetType(SS_CollectionDebugView(Of IKeyItem)))> _
    <DebuggerDisplay("KeyItemCollection {m_Id} {m_Name} {m_ExternalId} {m_Description}")> _
    <CLSCompliant(True)> _
    Public Class KeyItemCollection
        Inherits Collection(Of IKeyItem)
        Implements IKeyItemCollection

#Region "IKeyItem implements"

        Private m_Id As Integer
        Private m_Name As String
        Private m_Description As String
        Private m_IsValid As Boolean
        Private m_ExternalId As Integer

        ''' <summary>
        ''' The Unique Id of the Item.
        ''' </summary>
        ''' <value>Integer</value>
        ''' <remarks></remarks>
        ''' <history>
        '''     [ESCHNEIDER0]   2/17/2004   Created
        ''' </history>
        Public Property Id() As Integer Implements IKeyItem.Id
            Get
                Return m_Id
            End Get
            Set(ByVal value As Integer)
                m_Id = value
            End Set
        End Property

        ''' <summary>
        ''' The name of the Item.
        ''' </summary>
        ''' <value>String.</value>
        ''' <remarks></remarks>
        ''' <history>
        '''     [ESCHNEIDER0]   2/17/2004   Created
        ''' </history>
        Public Property Name() As String Implements IKeyItem.Name
            Get
                Return m_Name
            End Get
            Set(ByVal value As String)
                m_Name = value
            End Set
        End Property

        ''' <summary>
        ''' The Description of the item.
        ''' </summary>
        ''' <value>String.</value>
        ''' <remarks></remarks>
        ''' <history>
        '''     [ESCHNEIDER0]   2/17/2004   Created
        ''' </history>
        Public Property Description() As String Implements IKeyItem.Description
            Get
                Return m_Description
            End Get
            Set(ByVal value As String)
                m_Description = value
            End Set
        End Property

        ''' <summary>
        ''' Indicates if the object is valid.
        ''' </summary>
        ''' <value></value>
        ''' <remarks></remarks>
        ''' <history>
        '''     [ESCHNEIDER0]   2/17/2004   Created
        ''' </history>
        Public Overridable Property IsValid() As Boolean Implements IKeyItem.IsValid
            Get
                Return m_IsValid
            End Get
            Set(ByVal value As Boolean)
                m_IsValid = value
            End Set
        End Property

        ''' <summary>
        ''' Id used for End-User/Developer mapping.
        ''' </summary>
        ''' <value></value>
        ''' <remarks></remarks>
        ''' <history>
        '''     [ESCHNEIDER0]   2/17/2004   Created
        ''' </history>
        Public Property ExternalId() As Integer Implements IKeyItem.ExternalId
            Get
                Return m_ExternalId
            End Get
            Set(ByVal value As Integer)
                m_ExternalId = value
            End Set
        End Property

#End Region

#Region "ICloneable implements"

        Public Function Clone() As Object Implements System.ICloneable.Clone
            Return Me.Clone
        End Function

#End Region

    End Class


    Friend NotInheritable Class SS_CollectionDebugView(Of T)
        Private collection As ICollection(Of T)

        Public Sub New(ByVal collection As ICollection(Of T))
            If collection Is Nothing Then
                Throw New ArgumentNullException("collection")
            End If

            Me.collection = collection
        End Sub

        <DebuggerBrowsable(DebuggerBrowsableState.RootHidden)> _
        Public ReadOnly Property Items() As T()
            Get
                Dim m_items As T() = New T(collection.Count - 1) {}
                collection.CopyTo(m_items, 0)
                Return m_items
            End Get
        End Property
    End Class