sq / JSIL

CIL to Javascript Compiler
http://jsil.org/
Other
1.73k stars 241 forks source link

[Question] Custom implementations #964

Closed ghost closed 8 years ago

ghost commented 8 years ago

How would I write a custom implementation for classes? For example, Windows Forms, if I wanted to map the native controls to HTML elements such as buttons, inputs, etc...

kg commented 8 years ago

You can hand-write stubs in JS like the included ones, or you can write C# 'proxy' libraries that replace individual methods on the classes, or you can write a C# replacement for the entire library.

ghost commented 8 years ago

Could you give a quick example? There is a large amount of source to go through...How would I write a proxy class, in particular? I am not asking for a code sample, just a more specific guide to point me in the right direction... Thanks!

iskiselev commented 8 years ago

You could look on Proxies.4.0 and Proxies.Bcl projects as examples. Also look in wiki:https://github.com/sq/JSIL/wiki/Meta-Attributes. Also it will be good idea to look on https://github.com/sq/JSIL/wiki/Troubleshooting-FAQ and some scripts in Libraries\IgnoredBCL folder.

ghost commented 8 years ago

Thanks! I really appreciate the help!