Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C# version of VFP PEMSTATUS()
Message
De
20/01/2010 03:53:02
 
 
À
19/01/2010 17:16:23
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01444636
Message ID:
01444892
Vues:
43
>>You can also use linQ to see if the property exists and to return the properties value.
>>
>>if( MyClass.GetType().GetProperty (propName) != null)
>>{
>>     object propValue = MyClass.GetType().GetProperty(propName).GetValue(MyClass, new object[]{});
>>}
>>
>
>Where does Linq come into that?
>Oh - and before Gregory beats me to it - assigning a value to GetProperty() in the if clause would avoid having to re-evaluate if it's not null.....

You're way too fast
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform