using SharpKit.JavaScript;
[JsType(JsMode.Prototype, Filename = "~/Foo.js")]
public class Foo
{
public Foo()
{
this.CSharpName = "Bar";
}
[JsProperty(Name = "jsName", NativeField = true)]
public JsString CSharpName { get; private set; }
}
I get the following JavaScript:
/*Generated by SharpKit 5 v5.00.0000*/
if (typeof(SharpKitWebApp1) == "undefined")
var SharpKitWebApp1 = {};
SharpKitWebApp1.Foo = function ()
{
this.CSharpName = null;
this.jsName = "Bar";
};
So, the constructor in the JavaScript code nulls the C# property name instead
of the name defined in the JsProperty attribute. A constructor that doesn't set
CSharpName leaves the jsName property undefined.
----
-Michael Heyman
Original issue reported on code.google.com by DanelK...@gmail.com on 15 Dec 2012 at 1:10
Original issue reported on code.google.com by
DanelK...@gmail.com
on 15 Dec 2012 at 1:10