Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excluding private members from custom event args

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
Hello all,

I created a custom EventArgs class by inheriting from System.EventArgs. I have several ReadOnly properties so I set them from the constructor like so:
Code:
Imports System.ComponentModel

Public Class MyCustomEventArgs
    Inherits System.EventArgs

    Public Sub New(ByVal myArg1 As String)
        m_MyArg1 = myArg1
    End Sub 'New

    <EditorBrowsable(EditorBrowsableState.Never)> _
    Private m_MyArg1 As String = Nothing
    Public ReadOnly Property MyArg1 As String
        Get
            Return m_MyArg1 
        End Get
    End Property 'MyArg1
End Class
The problem is that in my delegate, if I click e while debugging at run time, m_MyArg1 shows up in the list. Thanks in advance for any ideas and/or suggestions.

 
Then why did you make it public readonly?

Did you try protected? or friend or protected friend?

Does it only show up on debugging or also on editing/coding/intellisense.

Christiaan Baes
Belgium

"My old site" - Me
 
Hey chrissie1,

At design time, the private properties do not show up in intellisense while I am coding. But at RunTime, if I set a break point in side my event code, then the private members m_MyArg1, etc are displayed in the list along with the property MyArg1 which is all that I want to be displayed.

I think you may have misread my post. I want the public property MyArg1 to display in intellisense, but not the private member m_MyArg1 which is used inside the custom EventArgs class which is inherited from System.EventArgs.

Thanks for taking time to respond!
 
I also tried Protected and Friend and they still show up in the list at RunTime.
 
Hey chrissie1,

Sorry, I misspoke above. They do not show up in Intellisense, but they do show up in the Locals window, which would be expected I believe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top