jeudi 29 octobre 2015

c# Reflection get dynamic members

I have an issue on reflection.

I Do have an ComObject's named Item (NewItem-> Instance). (interface)

For some reason I need some properties of this object.

var Item = typeof(IItem);
var props = Item.GetProperties();
foreach (var prop in props)
{
  var property = Item.GetProperty(prop.Name);
  var Propertytype = property.GetType().Name;
  if (Propertytype == "RuntimePropertyInfo")
  {
      var method = property.GetGetMethod();
      var  spesific = method.Invoke(NewItem, null);// spesific has dynamic Members...
  }
}

And I don't know how to get the Dynamic members.

Any ideas? Best regards Oliver





Aucun commentaire:

Enregistrer un commentaire