Generic collection class?

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-05-08T23:03:51Z Indexed on 2010/05/08 23:08 UTC
Read the original article Hit count: 147

Filed under:
|
|
|

Is there anyway I can do this?

class TSOC<TCollection, TValue> : ICollection<TValue>, INotifyCollectionChanged where TCollection : ICollection
{
    private TCollection<TValue> collection;
}

It doesn't like my definition of collection. I'd prefer the definition to look like TSOC<TCollection> where the user can pass in List<int> or something, but then I need to pull out the "int" to know what interface to implement.

© Stack Overflow or respective owner

Related posts about c#

Related posts about syntax