Sign in to follow this  
tstrimp

[.net] CodeDom / BooCompiler and object instances.

Recommended Posts

Is there a way to pass an instance of an object to either CodeDom or BooCompiler so that scripts can work with a particular instance of an object? For example, if the class I'm parsing the script in has a property called Name, how can I access that property for that particular instance within the script? I'm looking for something similar to Qt's QSA setup where I can add a pointer to a QObject to the interpreter and it would essentially make it a global variable with the same name as the object. void QSInterpreter::addTransientObject ( QObject * object )
Some Clarification I know I could pass an instance of the class I want to expose to the class / function I want to access it but one of my reasons for choosing Boo is that objects are not required. I would like the script to possible be as simple as.
SomeClassInstance.DoSomething("Doing it with scripts is better!")
I'd like to keep things as simple as possible for end users and would like to avoid them having to create a public static method within a class just to call a function or display something. [Edited by - tstrimp on March 6, 2007 1:49:33 PM]

Share this post


Link to post
Share on other sites
Looks like I can use InteractiveInterpreter's SetValue method for Boo. Anyone know of a similar system within CodeDom?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this