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

New Post: Type argument : how to make a typeof

0
0
Hello,

I exposed DataTable type to my javascript code :
C# code :
scriptEngine.AddHostObject("DotNet", new HostTypeCollection("mscorlib", "System.Core", "System.Data"));
But for adding columns, the Add method require a Type Parameter.
My Javascript code :
var dt = new DotNet.System.Data.DataTable("testDataTable");
dt.Columns.Add("Col1",DotNet.System.Int32);
The last line does not run 'invalid argument.
In C#, I should write this :
dt.Columns.Add("Col1",typeof(System.Int32));
How can I do the same of typeof in ClearScript / Javascript ?

Thanks for advance
Sybaris
PS : I discover ClearScript for a few days, and I am very impressed by all the work made, and the power of this engine...

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images