Application.cs 590 B

1234567891011121314151617181920212223242526272829303132333435
  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 System.ComponentModel;
  12. namespace System.Windows.Forms {
  13. public sealed class Application {
  14. public static void Run ()
  15. {
  16. Gtk.Application.Run ();
  17. }
  18. static void terminate_event_loop (object o, EventArgs args)
  19. {
  20. Gtk.Application.Quit ();
  21. }
  22. public static void Run (Form form)
  23. {
  24. form.Visible = true;
  25. form.Closed += new EventHandler (terminate_event_loop);
  26. Gtk.Application.Run ();
  27. }
  28. }
  29. }