.NET to Javascript compiler

C# code   Html page   Start
public class SummaryApp
{
    readonly static Item[] items = new Item[] { new Item("NumericTextBox"), new Item("Calendars"), new Item("JDatePickers"), 
        new Item("DropDowns"), new Item("Butons"), new Item("Window") 
    };

    readonly HtmlElement main;
    readonly TreeView<Node> treeView;
    readonly Grid<long?> grid;
    readonly NumericTextBox numericTextBox;
    TabStrip tabStrip;

    readonly IDisposable idle;
    SummaryApp()
    {
        main = HtmlDocument.Current.GetElementById("main");
        idle = PostNotifier.AdviseIdle(Idle);
        GridApp.ResizeMainElement(main);

        new Splitter(true, 0.25) { Element = main };
        new Splitter<SplitPane>(false, 0.5) { Element = HtmlDocument.Current.GetElementById("rightPane") };

        treeView = TreeViewApp.CreateTree(HtmlDocument.Current.GetElementById("tree"));
        new SplitPane().Element = (HtmlElement)treeView.Element.ParentNode;
        treeView.Selection.Advise(tree_SelectionChange);

        grid = GridApp.CreateGrid(HtmlDocument.Current.GetElementById("grid"));
        grid.RowsSelection.Advise(grid_SelectionChange);
        grid.DataSource = new DataSource(0, 1000000000);
        numericTextBox = new NumericTextBox((HtmlEditableElement)HtmlDocument.Current.GetElementById("numericTextBox"), true, 2, true);
        tabStrip = new TabStrip(HtmlDocument.Current.GetElementById("tabStrip"));
        AttachTabStrip(tabStrip);
        CalendarApp.InitCalendars();
        JDatePickerApp.InitPickers();
        DropDownApp.InitDropDowns();
        new Buttons().Element = HtmlDocument.Current.GetElementById("buttons");
        TreeViewApp.AdviseContextMenu(treeView);
        GridApp.AdviseContextMenus(grid);
        MenuApp.Start();
        GridApp.AdviseDragDrop(grid);
        TreeViewApp.AdviseDragDrop(treeView);
    }

    internal static void AttachTabStrip(TabStrip tabStrip)
    {
        for (int i = 0; i < items.Length; i++)
        {
            tabStrip.TabItems[i].Header = new ImageTextTabHeaderItem()
            {
                Text = items[i].Title,
                Tooltip = items[i].Title
            };
        }

        TabStripApp.AttachTabStrip(tabStrip);
    }
        
    void Idle()
    {
        idle.Dispose();
        main.Style.Visibility = StyleVisibility.Default;
    }

    public static void Start()
    {
        new SummaryApp();
    }

    void grid_SelectionChange()
    {
        if (grid.RowsSelection.FocusedRow >= 0)
        {
            numericTextBox.Value = (long)grid.DataSource[grid.RowsSelection.FocusedRow];
        }
        else
        {
            numericTextBox.Value = null;
        }
    }

    void tree_SelectionChange()
    {
        TreeSelection selection = treeView.Selection;

        if (selection.Nodes != null)
        {

            Node node = (Node)selection.Nodes.List[selection.Index];
            grid.DataSource = node.DataSource;
        }
        else
        {
            grid.DataSource = null;
        }
    }

    class Item
    {
        internal readonly string Title;
        internal Item(string title) { Title = title; }
    }
}

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" style="overflow:hidden;width:100%;height:100%">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta http-equiv="x-ua-compatible" content="IE=11;IE=10;IE=9;IE=8;IE=7" />
    <title>Summary.html: All controls</title>
    <link rel="stylesheet" href="styles/jscriptsuite.css?v2" type="text/css" />
    <link rel="stylesheet" href="styles/summary.css?v2" type="text/css" />
    <script type="text/javascript" language="javascript" src="js/summary.js?v3"></script>
</head>
<body onload="StartScript()" scroll="no" style="overflow:hidden;width:100%;height:100%;margin:0 0 0 0; background-image: url('images/loading.gif'); background-position:center center; background-repeat:no-repeat">
    Summary.html: all controls
    <div style="width:100%;height:20px" id="menubar" tabindex="1"></div>
    <div id="main" style="border: 1px solid #cccccc; visibility:hidden; background-color: white; width:100%">
        <div><div id="tree" style="width:100%;height:100%" tabindex="1" hidefocus="true"></div></div>
        <div id="rightPane">
            <div id="grid" tabindex="1" hidefocus="true">
            </div>
            <div id="tabStrip">
                <div style="overflow:auto;width:100%;height:100%">
                    NumericTextBox <input type="text" id="numericTextBox" style="width:150px; text-align:right" />
                </div>
                <div style="overflow:auto;width:100%;height:100%">
                    <table cellpadding="2" cellspacing="2">
                        <tr>
                            <th>1033</th>
                            <th>1031</th>
                        </tr>
                        <tr>
                            <td>
                                <div id="calendar1033" class="calendarWithImages" tabindex='1' hidefocus='true' style='outline:none'>
                                </div>
                            </td>
                            <td>
                                <div id="calendar1031" tabindex='1' hidefocus='true' style='outline:none'>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <th id="calendarValue1033">
                            </th>
                            <th id="calendarValue1031">
                            </th>
                        </tr>
                    </table>
                </div>
                <div style="overflow:auto;width:100%;height:100%">
                    <table cellpadding="2" cellspacing="0">
                        <tr>
                            <th>&#160;</th>
                            <th>1033 (Format g)</th>
                            <th>1031 (Format d)</th>
                        </tr>
                        <tr>
                            <td>Picker</td>
                            <td>
                                <span id="datePicker1033" contenteditable="true" class="datePicker"></span>
                            </td>
                            <td>
                                <span id="datePicker1031" contenteditable="true" class="datePicker"></span>
                            </td>
                        </tr>
                        <tr>
                            <td>Value (g)</td>
                            <td id="value1033"></td>
                            <td id="value1031"></td>
                        </tr>
                        <tr>
                            <td>Status</td>
                            <td id="status1033"></td>
                            <td id="status1031"></td>
                        </tr>
                    </table>
                </div>
                <div style="overflow:auto;width:100%;height:100%">
                    <table cellpadding="2" cellspacing="0">
                        <tr>
                            <th></th>
                            <th>Flat</th>
                            <th>Hierarchy</th>
                            <th>Grid</th>
                        </tr>
                        <tr>
                            <td>Picker</td>
                            <td>
                                <input type="text" style="width:100px" id="numericTextBoxFlat" />
                            </td>
                            <td>
                                <input type="text" style="width:100px" id="numericTextBoxHierarchy" />
                            </td>
                            <td>
                                <input type="text" style="width:100px" id="numericTextBoxGrid" />
                            </td>
                        </tr>
                        <tr>
                            <td>Value</td>
                            <td id="valueFlat"></td>
                            <td id="valueHierarchy"></td>
                            <td id="valueGrid"></td>
                        </tr>
                    </table>
                </div>
                <div style="overflow:auto;width:100%;height:100%" id="buttons">
                </div>
                <div style="overflow:auto;width:100%;height:100%">
                    <input type="button" value="Open Window" onclick="OpenWindow()" />
                    <input type="button" onclick="StartOK()" value="Start OK" />
                    <input type="button" onclick="StartOKCancel()" value="Start OKCancel" />
                    <input type="button" onclick="StartAbortRetryIgnore()" value="Start AbortRetryIgnore" />
                    <input type="button" onclick="StartYesNoCancel()" value="Start YesNoCancel" />
                    <input type="button" onclick="StartYesNo()" value="Start YesNo" />
                    <input type="button" onclick="StartRetryCancel()" value="Start RetryCancel" />
                    <input type="button" onclick="StartFreeHtml()" value="Start FreeHtml" />
                </div>
            </div>
        </div>
    </div>
    <div style="display:none">
        <div id="window" style="width:100%;height:100%;overflow:auto">
            Sample window Body
            <input type="button" value="Open Window" onclick="OpenWindow()" />
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            <input type="text" style="width:100px" />
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
            Sample window Body
        </div>
        <div id="freeHtml" style="width:100%;height:100%;overflow:auto">
            <div class="messageBoxText">
                Free Html
                <input type="button" onclick="StartOK()" value="Start OK" />
                <input type="button" onclick="StartOKCancel()" value="Start OKCancel" />
                <input type="button" onclick="StartAbortRetryIgnore()" value="Start AbortRetryIgnore" />
                <input type="button" onclick="StartYesNoCancel()" value="Start YesNoCancel" />
                <input type="button" onclick="StartYesNo()" value="Start YesNo" />
                <input type="button" onclick="StartRetryCancel()" value="Start RetryCancel" />
                Free Html
                Free Html
            </div>
        </div>
    </div>
</body>
</html>
© 2009 JScriptSuite. All rights reserved.