How to Hide inherited Object members from intellisense when coding?

W

wackyphill

...Such as ToString(), Equals(), etc.


[EditorBrowsable(EditorBrowsableState.Never)]
public override String ToString() { return
base.ToString(); }


The above (in C#) doesn't work.


Any ideas? And before you ask, Yes I do have a sane reason for wanting
to do this. :)
 
C

Chris

..Such as ToString(), Equals(), etc.


[EditorBrowsable(EditorBrowsableState.Never)]
public override String ToString() { return
base.ToString(); }


The above (in C#) doesn't work.


Any ideas? And before you ask, Yes I do have a sane reason for wanting
to do this. :)

I think this will work... However it won't stop someone from casting
your object as the baseobject and still accessing the object.

Private Shadows Property PublicPropertyYouWantToHide(...) ....
.....
End Property

I've used shadows often but never to change scope. Think it will work
though.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top