How do you override a virtual property in a generic class?

Tech-Archive recommends: Fix windows errors by optimizing your registry



....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

.



Relevant Pages

  • Re: C# Override limitation..why?
    ... > override so why can't it look for base.whateverin the base class? ... > look for methods in the base class where the signature parameters match ... It's not that the compiler ... static dispatch based on expression type. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: c program without main( ) ?
    ... Sometimes it is possible to override this with the C compiler, ... Don't you mean freestanding? ... Prev by Date: ...
    (comp.lang.c)
  • Re: Why does compiler only look at public methods of superclasses of...?
    ... Compiler enumerates all methods in class A and all public methods ... in the superclasses of A to find methods named x ... if method is declared final, static or private then compiler knows ... override a protected method. ...
    (comp.lang.java.programmer)
  • Re: Using DATACLASS
    ... I imagine if you don't supply values, the compiler ... code to override the compiler defaults; ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: Is overriding a function of a library in accordance with C++ standard?
    ... This is not an override of a C++ library, but an override of a C library function. ... The compile/link process you describe is how the compiler works. ... the compiler first searches the object files for all ... the same name in the libraries will be ignored. ...
    (microsoft.public.vc.mfc)