Collections - Documentation

  • Thread starter Thread starter Adam Dockter
  • Start date Start date
A

Adam Dockter

I am working with collection so naturally I have a class this is inheriting
from collection base.

The documentation based on .net framework v 1.1 has both Count and
GetEnumerator declared as virtual.

However when I go to override these methods I get the compiler error stating
that I cannot use override because the properties/methods were not declaired
as virtual, override or abstract.

Has anyone else ran into this? Is there a patch for it or am I just up a
creek?

Thanks
Adam dR.
 
Adam Dockter said:
I am working with collection so naturally I have a class this is inheriting
from collection base.

The documentation based on .net framework v 1.1 has both Count and
GetEnumerator declared as virtual.

However when I go to override these methods I get the compiler error stating
that I cannot use override because the properties/methods were not declaired
as virtual, override or abstract.

Has anyone else ran into this? Is there a patch for it or am I just up a
creek?

It's a mistake in the documentation - they're not virtual.
 
Adam,

The Count property is not overridable, even though the documentation
says it is. The same goes for the GetEnumerator method.

If you need to override these, then you should implement the IList
interface from scratch.

Hope this helps.
 
Back
Top