Hi everyone,
I hope this is the good place to ask my question - i'm a newbie on SharpKit so maybe there is an answer seomwhere else, but i was not able to find it.
I'm trying to use SharpKit to integrate the Windows Forms Designer in web forms (!!).
Basically, the process works like this :
1. "SharpKitLib" Library
A library called "SharpKitLib" uses SharpKit and provides a javascript implementation for all common windows forms controls (Component, Control, TextBox, Panel, etc.).
The implementation of the controls requires JsClr and so needs a compilation (<script>Compile(); </script>) and there is a namespace mapping between "SharpKitLib" namespace and "System" namespace.
For instance, the class "SharpKitLib.Drawing.Point" in C# will produce "System.Drawing.Point" in Javascript.
This part works really like a charm.
2. Using the tool
The developer, when he wants to use the project, has just to create a classical Windows Form project, and uses the designer to make his job.
Each class in this project, especially the Windows Form controls, must be decorated with [JsTypeAttribute] and will be generated in Javascript.
At the end, we have just to deploy the javascript files produced by "SharpKitLib" assembly and the developper custom assembly, and the web page works exactly like the Window form original project :)
The goal is to win time when make back office and repetitive screens, and then to put "SharpKitLib" open source.
My problem is on point 2, on "InitializeComponent()" designer method, we can have for example:
In C#:
> this.Location = new System.Drawing.Point( 100, 100 );
In Js:
>> this.set_Location( new System.Drawing.Point.ctor$$Int32$$Int32( 100, 100 ) );
And i expect to have :
>> this.set_Location( new System.Drawing.Point( 100, 100 ) );
The "System.Drawing.Point" class is generated like a JsClr class. In other words, SharpKit considers that this type is a part of the framework, and will generate appropriate code that can be handled by JsClr.js.
But in my case, i provide the javascript implementation of a Clr type - System.Drawing.Point in this example - that SharpKit do not manage natively.
Is there any way to fix my problem :
- Generate the good code above (remove the ".ctor$$Int32$$Int32") ?
OR
- Generate "SharpKitLib" code like a clr one (with all ...$$...() methods) ?
Thank you very much in advance.