CollectionBase class

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
Back
Top