[IronPython] Property information
curt at hagenlocher.org
Fri Jan 16 07:53:23 PST 2009
There is no one-to-one correspondence between Python types and CLR types.
In fact, there really can't be (at least in the default case) because their
respective types work totally differently.
You'll need to use the ObjectOperations API to access your Python methods:
engine.Operations.GetMember(object, "methodname") will return a delegate to
engine.Operations.InvokeMember(object, "methodname", arg1, arg2, ...) will
execute a method.
On Fri, Jan 16, 2009 at 1:58 AM, Stefan Glimberg
<stefanglimberg at gmail.com>wrote:
> I am creating a Silverlight application using C# and underlying python
> classes. In the C# code, I would like to access information about any
> methods defined in the python code. The python classes inherit from my
> own C# classes, but the only type information availible is from the C#
> class, not the python class.
> I get a python class inheriting my own 'Component' and its type like this:
> Compoenent c = ScriptEngine.GetVariable<Component>(Scope, mInstanceName);
> Type t = c.GetType();
> Calling fx. t.GetMembers() only returns members from the C# Component
> calss, nothing from the python class.
> Is there any way to access the methods defined in the python class also?
> - Glimberg
> Users mailing list
> Users at lists.ironpython.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Users