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

New Post: Generic types

$
0
0
Hi again,

My goal is to allow script developers to define structs or classes that will be usable by C# classes.

ClearScript allows C# code to access script objects directly via the dynamic keyword. Another possibility might be to use ClearScript's PropertyBag class, which gives you .NET collections that script code can treat much like native script objects.

So another idea I have, is to offer another API to construct dynamicly a C# class. Is it possible then to makes an AddHostType of a dynamic C# class ?

That's certainly an interesting way to go, and you should be able to use AddHostType() as long as you have a Type instance. We haven't tested with dynamically built types, but in theory they should work with ClearScript.

Good luck!

Viewing all articles
Browse latest Browse all 2297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>