Replace inherited member name

D

Dinis Correia

Hi all,
How can I replace an inherited member name?

I've built a class that inherits from KeyedCollection(Of ..., ...). I would
like to replace base class Items property with Fields property. Is this
possible?

TIA,
DC
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Dinis said:
Hi all,
How can I replace an inherited member name?

I've built a class that inherits from KeyedCollection(Of ..., ...). I
would like to replace base class Items property with Fields property. Is
this possible?

TIA,
DC

No, that's not possible. You can't remove members from a class that you
inherit.

You can create a Fields property that calls the Items property in the
base class, and override the Items property to throw an exception.
That's the closest that you can get.
 

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