Skip to content

Instantly share code, notes, and snippets.

@richorama
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richorama/d208284a6cccf311a9c8 to your computer and use it in GitHub Desktop.
Save richorama/d208284a6cccf311a9c8 to your computer and use it in GitHub Desktop.
Display WinForm from edge.js
var edge = require('edge');
var hello = edge.func(function () {/*
#r "System.Windows.Forms.dll"
using System.Windows.Forms;
using System.Threading.Tasks;
using System;
public class Startup
{
public Task<object> Invoke(string command)
{
var tcs = new TaskCompletionSource<object>();
var form = new Form();
var button = new Button();
var input = new TextBox();
button.Text = "Hello World";
button.Left = 100;
button.Top = 100;
input.Top = 100;
form.Controls.Add(button);
form.Controls.Add(input);
button.Click += (x,y) => {
var value = input.Text;
form.Close();
tcs.TrySetResult(value);
};
Application.Run(form);
return tcs.Task;
}
}
*/});
hello('', function (error, result) {
if (error) throw error;
console.log(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment