IronJS
IronJS copied to clipboard
can i expose c# object methods in javascript
I am attempting to extend my C# application with JavaScript using IronJS. I have a set of custom C# objects. I supply these objects as inputs to a JavaScript function. I am able to access fields and properties of my C# objects in the script, however methods and delegates of the same objects come back as undefined. Is there a way using IronJS to expose the methods as well? Perhaps I missed a step when defining the context ?
Thanks.
example = function(CSharpObject)
{
try
{
debug(CSharpObject.Field); // returns the correct value
debug(CSharpObject.Method()); // returns undefined
}
catch(err)
{
debug(""Error: "" + err.message);
}
}
Hey!
This project is abandoned.
Sorry