rgn2121
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?
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, just wanted to know if it was possible in the sense of anyone using my classes. I understand and have created snippets, but thank you for the link.
ASKER
What if, like IDisposable, I want my interface to add some code as well as the method signature?