views:

48

answers:

1

Greetings,

Most of the information I see around concerning the construction of Proxies for objects assume that there exists a Type somewhere which defines the members to be proxied. My problem is: I can't have any such type.

To make the problem simpler, what I have is a dictionary that maps strings to objects. I also have getters and setters to deal with this dictionary.

My goal then is to provide transparent access inside IronPython to this getters and setters as if they were real properties of a class. For example, the following code in a python script:

x.result = x.input * x.percentage;

...would actually represent something like in the host language:

x.SetProperty("result", x.GetProperty("input") * x.GetProperty("percentage"));

Also, 'x' here is given by the host program. Any ideas? Please remember that I cannot afford the creation of a typed stub... Ideally, I would be happy if somehow I could intercept every call to an attribute/method of a specific object in the script language onto the host program.

+1  A: 

This post might be useful.

srivatsn