How do you override a virtual property in a generic class?
- From: "Geoff" <opinionatedgeek@xxxxxxxxx>
- Date: 12 Jul 2005 08:51:54 -0700
....Or, to put it another way, why doesn't something like this work?
public class RecordCollection : List<Record>
{
//Some code snipped
public override int Count
{
get
{
return someCustomCount;
}
}
}
The error the compiler gives is 'cannot override inherited member
'System.Collections.Generic.List<OpinionatedGeek.Applications.Alchemy.Record>.Count.get'
because it is not marked virtual, abstract, or override'
That may well be true, but
'System.Collections.Generic.List<>.Count.get' _is_ marked virtual. How
do I go about overriding it? Or is it just not possible?
Any ideas? Or any better places to post this question?
Many thanks,
Geoff
.
- Follow-Ups:
- Re: How do you override a virtual property in a generic class?
- From: Nicholas Paldino [.NET/C# MVP]
- Re: How do you override a virtual property in a generic class?
- Prev by Date: Re: Refresh paren't window's grid when child window closes
- Next by Date: Re: Dynamic web service binding during runtime
- Previous by thread: Dynamic web service binding during runtime
- Next by thread: Re: How do you override a virtual property in a generic class?
- Index(es):
Relevant Pages
|