Currently there isn't a way to create a new ScriptScope object based on an
existing one.
If I understand your query correctly, you can do what you want by iterating
over the items of an existing object and copy them over the newer one as soon
as your create a new one. Won't this work for you?
ScriptScope newScope = _pyEng.CreateScope();
foreach (var item in existingScope.Items) {
newScope.SetVariable(item.Key, item.Value);
}
Thanks
sesh
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andy.Tao
Sent: Saturday, August 09, 2008 12:08 AM
To: Users
Subject: [IronPython] Is there a way to create a new ScriptScope that inherits
from global ScriptScope?
HI guys,
Is there a way to create a new ScriptScope that inherits from global
ScriptScope?
I want to do it like this:
first step: expose some object model to global scope and some global variables;
second step: execute task script in independ scope to avoid modify global
objects and variables.
thanks in advanced.
------------------
Andy Tao
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com