JavaScript, C#, and ExtSharp

Colin Ramsay thinks that JavaScript and C# can be scarily similar as he shows an ExtJS example:


JAVASCRIPT:
  1. var win = new Ext.Window({
  2. title: 'Order Viewer', layout: 'border',
  3. width: 500, height: 500,
  4. modal: true, resizable: false, closable: false, draggable: false,
  5. items: [ frm, lst ]
  6. });
  7. win.on('render', function() {
  8. load(5);
  9. });
  10. win.show();


C#:

  1. var win = new Ext.Window{
  2. Title = "OrderViewer", Layout = Layout.Border,
  3. Width = 100, Height = 200,
  4. Modal = true, Resizable = false, Closable = false, Draggable = false,
  5. Items = new [] { frm, lst }
  6. };
  7. win.Render += delegate {
  8. load(5);
  9. };
  10. win.show();

This works well for ExtJS since it is written in a style that leads itself to this similarity. Colin also points out ExtSharp, a project that lets you write your Ext application in C#:

If you have better solution, just tell me !

0 comments: