.NET to Javascript compiler

C# code   Html page   Start
public class MultiSelectionApp
{
    readonly HtmlElement header, footer;
    readonly HtmlElement box, checkedList;
        
    MultiSelectionApp()
    {
        HtmlTable table = (HtmlTable)HtmlDocument.Current.GetElementById("main");
        header = table.Rows[0];
        footer = table.Rows[2];
        box = HtmlDocument.Current.GetElementById("box");
        InitBox();
        checkedList = HtmlDocument.Current.GetElementById("checkedList");
        InitCheckedList();
        InitCheckedDropDown(HtmlDocument.Current.GetElementById("checkedDropDown"));
        HtmlWindow.Current.AdviseResize(Resize);
        Resize();
    }

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

    void Resize()
    {
        checkedList.Style.Width = 
            box.Style.Width = (HtmlWindow.Current.InnerWidth / 2 - 60) + "px";
        HtmlRect rc = header.GetBoundingClientRect();
        checkedList.Style.Height = 
            box.Style.Height = Math.Max(HtmlWindow.Current.InnerHeight - rc.Bottom - 4 - footer.OffsetHeight, 10) + "px";
    }

    void InitBox()
    {
        new MultiSelectorBox<Node>(null)
        {
            Element = box,
            DataSource = new NodeSource(1000, 100),
            Renderer = CreateRenderer().Render
        };
    }

    void InitCheckedList()
    {
        new CheckedListBoxPane<Node>(null)
        {
            Element = checkedList,
            DataSource = new NodeSource(1000, 100),
            Renderer = CreateRenderer().Render
        };
    }

    void InitCheckedDropDown(HtmlElement element)
    {
        CheckedDropDownList<Node> dropDown = new CheckedDropDownList<Node>(null)
        {
            Element = element
        };

        dropDown.CheckedListBoxPane.DataSource = new NodeSource(1000, 100);
        dropDown.CheckedListBoxPane.Renderer = CreateRenderer().Render;
        dropDown.CheckedListBoxPane.MultiSelectionProvider.Advise(delegate()
        {
            element.InnerText = string.Format("{0}/{1}",
                dropDown.CheckedListBoxPane.MultiSelectionProvider.Selected.Count,
                dropDown.CheckedListBoxPane.MultiSelectionProvider.Source.Count);
        });
    }

    internal static ImageTextRenderer CreateRenderer()
    {
        ImageTextRenderer renderer = new ImageTextRenderer();

        renderer.Image.Image = delegate(object o)
        {
            Node node = (Node)o;
            return (node.Start + node.Count) % 3 != 0 ? "images/folderWin7.gif" : null;
        };

        renderer.Text.Text = delegate(object o) { return o.ToString(); };

        return renderer;
    }        

    class MultiSelectionValue
    {
        readonly IObservableList list;
            
        internal MultiSelectionValue(IObservableList list)
        {
            this.list = list;
        }

        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();
            return stringBuilder.ToString();
        }
    }
}

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" style="overflow:hidden;width:100%;height:100%">
<head>
  <title>Multi Selection</title>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
    <meta http-equiv="x-ua-compatible" content="IE=11;IE=10;IE=9;IE=8;IE=7" />
    <link rel="stylesheet" href="styles/jscriptsuite.css" type="text/css" />
    <link rel="stylesheet" href="styles/summary.css" type="text/css" />
    <script type="text/javascript" src="js/multiSelection.js"></script>
  </head>
	<body onload="StartScript()" style="overflow:hidden;width:100%;height:100%;padding:0;margin:0">
    MultiSelection.html
      <table cellpadding="2" cellspacing="0" style="width:100%" id="main">
          <tr>
            <th>CheckedDropDownList</th>
            <th>CheckedListBox</th>
              <th>Box</th>
          </tr>
          <tr>
            <td style="padding:2px; vertical-align:top">
              <div id="checkedDropDown" style="width:100px" class="dropdownInline"></div>
            </td>
            <td style="padding:2px">
                <div id="checkedList" style="overflow:hidden"></div>
              </td>
              <td style="padding:2px">
                <div id="box" style="overflow:hidden"></div>
              </td>
          </tr>
          <tr style="height:20px">
              <td id="dropDownValue"></td>
              <td id="boxValue"></td>
          </tr>
      </table>
  </body>
</html>
© 2009 JScriptSuite. All rights reserved.