WindowClosed() public method

public WindowClosed ( ) : void
return void
コード例 #1
0
ファイル: Note.cs プロジェクト: cnmade/SparkleShare
        public Note() : base("Add Note")
        {
            SetWmclass("SparkleShare", "SparkleShare");

            IconName       = "org.sparkleshare.SparkleShare";
            Resizable      = false;
            WindowPosition = WindowPosition.CenterAlways;
            BorderWidth    = 16;

            SetSizeRequest(480, 120);


            DeleteEvent += delegate(object o, DeleteEventArgs args) {
                Controller.WindowClosed();
                args.RetVal = true;
            };

            KeyPressEvent += delegate(object o, KeyPressEventArgs args) {
                if (args.Event.Key == Gdk.Key.Escape ||
                    (args.Event.State == Gdk.ModifierType.ControlMask && args.Event.Key == Gdk.Key.w))
                {
                    Controller.WindowClosed();
                }
            };

            Controller.HideWindowEvent += delegate {
                Application.Invoke(delegate { Hide(); });
            };

            Controller.ShowWindowEvent += delegate {
                Application.Invoke(delegate {
                    if (Child != null)
                    {
                        Remove(Child);
                    }

                    CreateNote();
                    ShowAll();
                    Present();
                });
            };

            Controller.UpdateTitleEvent += delegate(string title) {
                Application.Invoke(delegate { Title = title; });
            };
        }
コード例 #2
0
ファイル: Note.xaml.cs プロジェクト: zz38/SparkleShare
 private void OnClosing(object sender, CancelEventArgs cancel_event_args)
 {
     Controller.WindowClosed();
     cancel_event_args.Cancel = true;
 }