In the documentation for an abstract base class, ie. CollectionBase, how
does one tell which methods must be implemented in the derived class ? I see
no information in the MSDN documentation on which method, properties, or
events are abstract and need to be overridden for abstract classes.
I know I can decompile the assembly using ildasm, but I wonder if there is
any tool which can decompile the assembly to a .NET language such as C# or
MC++ as MSIL is a bit of a pain to read ?
Edward,
>I see
>no information in the MSDN documentation on which method, properties, or
>events are abstract and need to be overridden for abstract classes.
If you look at the method signature in the docs, it does include the
keyword abstract for abstract methods and properties.
Also, the compiler will give you an error for any abstract members
that you haven't implemented.
CollectionBase has no abstract members.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Edward Diener - 30 Dec 2003 01:05 GMT
> Edward,
>
[quoted text clipped - 10 lines]
>
> CollectionBase has no abstract members.
The documentation says that it is an abstract class. Doesn't this mean that
it has at least one abstract method ?
Mattias Sj?gren - 30 Dec 2003 02:12 GMT
Edward,
>Doesn't this mean that
>it has at least one abstract method ?
No
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Edward Diener - 30 Dec 2003 02:44 GMT
> Edward,
>
>> Doesn't this mean that
>> it has at least one abstract method ?
>
> No
OK, I have picked up the idea that an abstract class does not need to have
at least one abstract method. No wonder I couldn't find any in
CollectionBase <g> .
I am still struggling to understand CollectionBase as a base class for my
own collection, as the documentation is pretty terrible in explaining what
needs to be overridden and what can be overridden for typed collections. I
do understand that, at the minimum, the Add and Remove methods and the Item
property needs to be implemented. The rest of the methods and properties
from IList and ICollection, as well as the methods from CollectionBase, seem
difficult to understand in their relationship to each other and whether
there is any point in overriding them. I will look for an explanation of
.NET custom collections on the Internet.
Edward Diener - 30 Dec 2003 03:27 GMT
> Edward,
>
>> Doesn't this mean that
>> it has at least one abstract method ?
>
> No
I found a very good article at
http://www.informit.com/isapi/guide~dotnet/seq_id~119/guide/content.asp
which explains custom collections derived from CollectionBase very well.