Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting to Properties in derived class from base
Message
 
À
01/11/2010 13:22:17
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
Divers
Thread ID:
01487780
Message ID:
01487790
Vues:
41
>Hi all,
>
>If I have a base class, and App level class, and several inherited classes but have added a property in the App Level classe, how can I get to it from the base? I have a reference to the class in the base
>

Reflection, like Viv showed. Or create a simple interface that has this property in it, then make your inherited classes inherit from this interface as well. Then just cast the reference you're holding to that interface and (if it's not null) you can access the property.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform