May 2010
Intermediate to advanced
1272 pages
61h 18m
English
MyClass KeywordAnother way for accessing base classes’ members is the MyClass keyword. Imagine you have a base class exposing some overridable members, such as properties or methods; then you have a derived class that overrides those members. The MyClass keyword avoids the application of overriding and invokes members on the derived class as if they were NotOverridable on the base class. In other words, MyClass enables executing members of a base class in the context of a derived class, ensuring that the member version is the one in the base class. Listing 12.1 shows an example.
Listing 12.1 Demonstrating the MyClass Keyword

The BaseClassDemo ...
Read now
Unlock full access