Avatar of rgn2121
rgn2121
Flag for United States of America

asked on 

How do I show detailed info in my interfaces? Trying to mimic IDisposable look.

I am creating an interface for use in my application and I was curious how to make my interface show some of the detail that IDisposable(shown below) does.  When you type implements IDisposable, all the code in the code window gets added.

I would like to add a region such as:

#Region "MyInterface support"
#End Region

or even show comments like the IDisposable does.  I have tried just adding them in the interface, but there must be something else I need to do.  I am curious if anyone knows how to do this?
Private disposedValue As Boolean = False        ' To detect redundant calls
    ' IDisposable
    Protected Overridable Sub Dispose(ByVal disposing As Boolean)
        If Not Me.disposedValue Then
            If disposing Then
                ' TODO: free managed resources when explicitly called
            End If
 
            ' TODO: free shared unmanaged resources
        End If
        Me.disposedValue = True
    End Sub
 
#Region " IDisposable Support "
    ' This code added by Visual Basic to correctly implement the disposable pattern.
    Public Sub Dispose() Implements IDisposable.Dispose
        ' Do not change this code.  Put cleanup code in Dispose(ByVal disposing As Boolean) above.
        Dispose(True)
        GC.SuppressFinalize(Me)
    End Sub
#End Region

Open in new window

.NET ProgrammingVisual Basic.NET

Avatar of undefined
Last Comment
rgn2121

8/22/2022 - Mon