To override a getter on a subclass in C#, you need to follow these steps:
override
keyword followed by the access modifier of the property (public, private, etc) and the keyword get
.base
keyword followed by the property name.Here's an example:
main.cs405 chars20 lines
In this example, MySubclass
overrides the MyProperty
getter in MyBaseClass
. The overridden property calls the base class's getter and then adds "Override: " to the beginning of the returned string.
gistlibby LogSnag