fholm / IronJS

IronJS - A JavaScript implementation for .NET
http://ironjs.wordpress.com
Apache License 2.0
680 stars 79 forks source link

can i expose c# object methods in javascript #104

Open jharonfe opened 9 years ago

jharonfe commented 9 years ago

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);
}
}

fholm commented 9 years ago

Hey!

This project is abandoned.

Sorry