PdfMod.Gui.Client.Quit C# (CSharp) Method

Quit() public method

public Quit ( ) : void
return void
        public void Quit ()
        {
            if (Window == null) {
                return;
            }

            if (PromptIfUnsavedChanges ()) {
                return;
            }

            if (Document != null) {
                Document.Dispose ();
            }

            if (IconView != null) {
                IconView.Dispose ();
                IconView = null;
            }

            Window.Destroy ();
            Window = null;

            if (--app_count == 0) {
                try {
                    Directory.CreateDirectory (Path.GetDirectoryName (accel_map_file));
                    Gtk.AccelMap.Save (accel_map_file);
                } catch (Exception e) {
                    Hyena.Log.Exception ("Failed to save custom AccelMap", e);
                }

                Application.Quit ();
            }
        }

Usage Example

Beispiel #1
0
 void OnClose(object o, EventArgs args)
 {
     app.Quit();
 }