Mike in this case is probably Michael Foord. http://www.ironpythoninaction.com/
Here's a good place to start (from Mike's blog): http://www.voidspace.org.uk/ironpython/hosting_api.shtm There are lots of variations of hosting, and many patterns. Sounds like you might be wanting to define classes in IPy and instantiate them. Basically, you run the script that defines the class, then get the class object from the runtime scope, then invoke the constructor which returns an instance of the object. Casting should work in that case (provided of course that you've derived from the type in question). For example: public T Load<T>(string path, params object[] parameters) where T : class { ScriptSource script = _engine.CreateScriptSourceFromFile(path); CompiledCode code = script.Compile(); string className = Path.GetFileNameWithoutExtension(path); # this is just a convention object theClass = _scope.GetVariable(className); object instance = _engine.Operations.Invoke(theClass, parameters); return instance as T; } This isn't the only info you need, but should give you an idea of how it works. Try searching for "ironpython hosting" Hope this helps. On Mon, Nov 2, 2009 at 4:59 PM, Frank Merrow <[email protected]> wrote: > At 01:43 PM 11/2/2009, Justin Regele wrote: > >> Embedding IPy in C# isn't easy at first, and definitely not super >> straight-forward, but there are alot of options of how to do it. Get Mike's >> book, or at least download the source for the embedding chapter. Embedding >> ironpython is tricky now, but things are progressing quickly, and there ARE >> lots of ways to do it--different techniques for different situations. >> > > Okay, maybe everyone on this list knows, but I don't . . . > > Mike Who and what book? > > > Frank > > _______________________________________________ > Users mailing list > [email protected] > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >
_______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
