c# - Get Dynamic Members and SetValue from Interop Object -
c# - Get Dynamic Members and SetValue from Interop Object -
i have interop object comes system.__comobject , want set values using variable name:
setvalue(fieldname) = fieldvalue;
i need inspect dynamic members see what’s available. members (the ones ending in ref) have sub-members need drill-down them well.
in debug, dynamic members come follows. (sorry,i can't post images)
http://www.mezzodev.com/qintegrator/download/debug1.png
http://www.mezzodev.com/qintegrator/download/debug2.png
using impromptu interface able gather dynamic members with:
var membernames = impromptu.getmembernames(customeradd, dynamiconly:true);
then can set using variable fellow member name with:
string optfield = "phone"; string optvalue = "818-555-1212"; impromptu.invokeget(customeradd, optfield).setvalue(optvalue);
a big "thank you!" developer of impromptu interface answering me.
c# reflection reflection.emit system.reflection
Comments
Post a Comment