示例#1
0
		public MainWindow(ShellForms parent) {
			this.parent = parent;
			this.Title = "Alarm Clock";

			base.Add (new Label (2, 2) { Text = "Wake-up time: " });

			var txtWakeupTime = new Textbox (16, 2, 5);
			txtWakeupTime.Text = DateTime.Now.AddMinutes (1).ToString ("HH:mm");
			base.Add (txtWakeupTime);

			var btnStartStop = new Button (22, 2, "Start");
			base.Add (btnStartStop);

			this.lblTime = new Label (2, 4, 8);
			base.Add (this.lblTime);
		}
示例#2
0
		public static void Main (string[] args)
		{
			var sf = new ShellForms ();

			// build
			var ui = new MainWindow (sf);
			var clock = new Clock ();

			// bind
			clock.OnClockTick += ui.Display_time;

			// run
			using (clock) {
				clock.Start ();
				sf.Run (ui);
			};
		}
示例#3
0
		public static void Main (string[] args)
		{
			// build
			var dlg = new MainDlg ();
			var cmd = new CommandlineProvider ();
			var txt = new TextfileProvider ();
			var pager = new Pager ();
			var formatter = new Formatter ();
			var ep = new Entrypoints (cmd, txt, pager, formatter);
			var app = new App (dlg, ep);

			// run
			app.Start ();

			var sf = new ShellForms ();
			sf.Run (dlg);
		}