CollectionBase class

G

Guest

I try to write a class derived form CollectionBase and hide the methods:
Clear() and RemoveAt().
In the documentation the methods are described as overridable (virtual). But
any try like following fails with compiler error:

public override void Clear()
{}

Error: cannot override inherited member .... because its not marked virtual,
abstract or override.

Isn't this possible, or what am I doing wrong?
 
C

Claes Bergefall

The documentation is incorrect.
They are not overridable.

You can use one of the OnXXX (OnRemove etc)
methods if you need to verify things before or
after a remove/clear operation.

/claes
 

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