Robert Jordan
10/14/2004 9:57:00 PM
Brian Fung wrote:
> Hello all,
>
> I have that common problem of wanting a class to inherit both
> MarshalByRefObject and System.Collections.Collectionbase.
>
> Since multiple inheritence is not supported in .NET and from what I
> read so far in the newsgroup, I notice that the solution (correct me
> if I'm wrong) is to inherit the class MarshalByRefObject and the
> interface System.Collections.ICollection.
>
> Since any interface only provides you the header of all public methods
> and properties, does that mean I have to reprogram or emulate all the
> functionality (ex: Count, Add, Remove) and properties of the
> System.Collections.Collectionbase??? Or am I reading this wrong?
You have. But you can use a concrete ICollection implementation
and delegate to that object, since ICollection isn't that huge:
public A : MarshalByRefObject, ICollection
{
ArrayList innerList;
public int Count {
get { return innerList.Count }
}
...
}
bye
Rob