We help IT Professionals succeed at work.
Get Started

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

218 Views
Last Modified: 2013-11-26
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

Comment
Watch Question
Software Architect
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE