Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Global window object

0
0
Hi again,

It sounds like you really want window to be the same as the global object, and that's very easy to set up:
engine.Execute("window = this");
Then you could simply expose your GlobalMembers host object under a different (dummy) name:
engine.AddHostObject("_window", HostItemFlags.GlobalMembers, new MyWindow());
With this setup, your host object's members - and any dynamic properties added by script code - are visible in both window and the global object (because they're one and the same). In fact, this way your host object might not need dynamic support at all.

Good luck!

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images