Application.cs 617 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // System.Windows.Forms.Application
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. //
  7. // (C) 2002 Ximian, Inc
  8. //
  9. using System;
  10. using System.Drawing;
  11. using Gtk;
  12. using GtkSharp;
  13. using System.ComponentModel;
  14. namespace System.Windows.Forms {
  15. public sealed class Application {
  16. public static void Run ()
  17. {
  18. Gtk.Application.Run ();
  19. }
  20. static void terminate_event_loop (object o, EventArgs args)
  21. {
  22. Gtk.Application.Quit ();
  23. }
  24. public static void Run (Form form)
  25. {
  26. form.Visible = true;
  27. form.Closed += new EventHandler (terminate_event_loop);
  28. Gtk.Application.Run ();
  29. }
  30. }
  31. }