D
Damien DORISON
Hi all,
i try to call InvokeMember on a type for a property. This works fine
for .Net Framwork 1.1 but generates an exception
"NotSupportedException" for Compact Framework. It works also fine when
invoking a method (instead of a property) on the Compact Framework.
This is not documented in VS documentation, so, is there a probleme
with my calling (code sample is bellow) or is InvokeMember not
implemented on CompactFramework for properties.
Many thanks,
Damien
// Class to Reflect
public class Class1
{
public int MyProperty
{
get
{
return 12;
}
}
}
}
// Call for reflexion
Assembly a = Assembly.GetExecutingAssembly();
Type t = a.GetType("Class1");
object ob = a.CreateInstance("Class1");
try
{
object o = t.InvokeMember("MyProperty", BindingFlags.Default |
BindingFlags.GetProperty, null, ob, new object[] {});
}
catch(Exception ee)
{
string s = ee.Message;
}
i try to call InvokeMember on a type for a property. This works fine
for .Net Framwork 1.1 but generates an exception
"NotSupportedException" for Compact Framework. It works also fine when
invoking a method (instead of a property) on the Compact Framework.
This is not documented in VS documentation, so, is there a probleme
with my calling (code sample is bellow) or is InvokeMember not
implemented on CompactFramework for properties.
Many thanks,
Damien
// Class to Reflect
public class Class1
{
public int MyProperty
{
get
{
return 12;
}
}
}
}
// Call for reflexion
Assembly a = Assembly.GetExecutingAssembly();
Type t = a.GetType("Class1");
object ob = a.CreateInstance("Class1");
try
{
object o = t.InvokeMember("MyProperty", BindingFlags.Default |
BindingFlags.GetProperty, null, ob, new object[] {});
}
catch(Exception ee)
{
string s = ee.Message;
}