mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-29 02:11:28 -06:00
64 lines
1.3 KiB
C#
64 lines
1.3 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Scripting
|
|
{
|
|
public class Form1 : System.Windows.Forms.Form
|
|
{
|
|
private System.ComponentModel.Container components = null;
|
|
|
|
public Form1()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
protected override void Dispose( bool disposing )
|
|
{
|
|
if( disposing )
|
|
{
|
|
if(components != null)
|
|
{
|
|
components.Dispose();
|
|
}
|
|
}
|
|
base.Dispose( disposing );
|
|
}
|
|
#region Windows Form Designer generated code
|
|
private void InitializeComponent()
|
|
{
|
|
this.SuspendLayout();
|
|
//
|
|
// Form1
|
|
//
|
|
this.ClientSize = new System.Drawing.Size(432, 261);
|
|
this.Name = "Form1";
|
|
this.Text = "MyApp";
|
|
this.ResumeLayout(false);
|
|
|
|
}
|
|
#endregion
|
|
|
|
private void button1_Click(object sender, System.EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
}
|
|
|
|
class Script
|
|
{
|
|
const string usage = "Usage: cscscript WinForm ...\nThe primitive example that demonstrates how to create WinForm application.\n";
|
|
[STAThread]
|
|
static public void Main(string[] args)
|
|
{
|
|
if (args.Length == 1 && (args[0] == "?" || args[0] == "/?" || args[0] == "-?" || args[0].ToLower() == "help"))
|
|
{
|
|
Console.WriteLine(usage);
|
|
}
|
|
else
|
|
{
|
|
Application.Run(new Form1());
|
|
}
|
|
}
|
|
}
|
|
} |