How can i get some parameters (or attributes, if they are called so), with reflection?
MyObject x = new MyObject(...);
..........
var propInfo = x.GetType().GetProperty("something");
if (propInfo != null) {
xyz= propInfo.GetValue(x,null).Metrics.Width //<------ gives error
}
Aucun commentaire:
Enregistrer un commentaire