WindowClosed() public méthode

Closing the dialog.
public WindowClosed ( ) : void
Résultat void
Exemple #1
0
        public About() : base()
        {
            using (var a = new NSAutoreleasePool())
            {
                SetFrame(new RectangleF(0, 0, 640, 281), true);
                Center();

                Delegate    = new AboutDelegate();
                StyleMask   = (NSWindowStyle.Closable | NSWindowStyle.Titled);
                Title       = String.Format(Properties_Resources.About, Properties_Resources.ApplicationName);
                MaxSize     = new SizeF(640, 281);
                MinSize     = new SizeF(640, 281);
                HasShadow   = true;
                BackingType = NSBackingStore.Buffered;

                this.website_link       = new CmisSyncLink(Properties_Resources.Website, Controller.WebsiteLinkAddress);
                this.website_link.Frame = new RectangleF(new PointF(295, 25), this.website_link.Frame.Size);

                this.credits_link       = new CmisSyncLink(Properties_Resources.Credits, Controller.CreditsLinkAddress);
                this.credits_link.Frame = new RectangleF(
                    new PointF(this.website_link.Frame.X + this.website_link.Frame.Width + 10, 25),
                    this.credits_link.Frame.Size);

                this.report_problem_link       = new CmisSyncLink(Properties_Resources.ReportProblem, Controller.ReportProblemLinkAddress);
                this.report_problem_link.Frame = new RectangleF(
                    new PointF(this.credits_link.Frame.X + this.credits_link.Frame.Width + 10, 25),
                    this.report_problem_link.Frame.Size);

                this.hidden_close_button = new NSButton()
                {
                    Frame = new RectangleF(0, 0, 0, 0),
                    KeyEquivalentModifierMask = NSEventModifierMask.CommandKeyMask,
                    KeyEquivalent             = "w"
                };

                this.hidden_close_button.Activated += delegate {
                    Controller.WindowClosed();
                };


                ContentView.AddSubview(this.hidden_close_button);

                CreateAbout();

                ContentView.AddSubview(this.website_link);
                ContentView.AddSubview(this.credits_link);
                ContentView.AddSubview(this.report_problem_link);
            }

            Controller.HideWindowEvent += delegate {
                using (var a = new NSAutoreleasePool())
                {
                    InvokeOnMainThread(delegate {
                        PerformClose(this);
                    });
                }
            };

            Controller.ShowWindowEvent += delegate {
                using (var a = new NSAutoreleasePool())
                {
                    InvokeOnMainThread(delegate {
                        OrderFrontRegardless();
                    });
                }
            };

            Controller.NewVersionEvent += delegate(string new_version) {
                using (var a = new NSAutoreleasePool())
                {
                    InvokeOnMainThread(delegate {
                        this.updates_text_field.StringValue = "A newer version (" + new_version + ") is available!";
                        this.updates_text_field.TextColor   = NSColor.FromCalibratedRgba(0.45f, 0.62f, 0.81f, 1.0f);
                    });
                }
            };

            Controller.VersionUpToDateEvent += delegate {
                using (var a = new NSAutoreleasePool())
                {
                    InvokeOnMainThread(delegate {
                        this.updates_text_field.StringValue = "You are running the latest version.";
                        this.updates_text_field.TextColor   = NSColor.FromCalibratedRgba(0.45f, 0.62f, 0.81f, 1.0f);
                    });
                }
            };

            Controller.CheckingForNewVersionEvent += delegate {
                using (var a = new NSAutoreleasePool())
                {
                    InvokeOnMainThread(delegate {
                        this.updates_text_field.StringValue = "Checking for updates...";
                        this.updates_text_field.TextColor   = NSColor.FromCalibratedRgba(0.45f, 0.62f, 0.81f, 1.0f);
                    });
                }
            };
        }
Exemple #2
0
        public About() : base("")
        {
            DeleteEvent += delegate(object o, DeleteEventArgs args) {
                Controller.WindowClosed();
                args.RetVal = true;
            };

            DefaultSize    = new Gdk.Size(600, 260);
            Resizable      = false;
            BorderWidth    = 0;
            IconName       = "dataspacesyc-folder";
            WindowPosition = WindowPosition.Center;
            Title          = String.Format(Properties_Resources.About, Properties_Resources.ApplicationName);
            AppPaintable   = true;

            string image_path = System.IO.Path.Combine(UI.AssetsPath, "pixmaps", "about.png");

            Realize();
            Gdk.Pixbuf buf = new Gdk.Pixbuf(image_path);
            Gdk.Pixmap map, map2;
            buf.RenderPixmapAndMask(out map, out map2, 255);
            GdkWindow.SetBackPixmap(map, false);

            CreateAbout();

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

            Controller.ShowWindowEvent += delegate {
                Application.Invoke(delegate {
                    ShowAll();
                    Present();
                });
            };

            Controller.NewVersionEvent += delegate(string new_version) {
                Application.Invoke(delegate {
                    this.updates.Markup = String.Format("<span font_size='small' fgcolor='#729fcf'>{0}</span>",
                                                        string.Format(Properties_Resources.NewVersionAvailable, new_version));

                    this.updates.ShowAll();
                });
            };

            Controller.VersionUpToDateEvent += delegate {
                Application.Invoke(delegate {
                    this.updates.Markup = String.Format("<span font_size='small' fgcolor='#729fcf'>{0}</span>",
                                                        Properties_Resources.RunningLatestVersion);

                    this.updates.ShowAll();
                });
            };

            Controller.CheckingForNewVersionEvent += delegate {
                Application.Invoke(delegate {
                    // this.updates.Markup = String.Format ("<span font_size='small' fgcolor='#729fcf'>{0}</span>",
                    //    "Checking for updates...");

                    this.updates.ShowAll();
                });
            };
        }
Exemple #3
0
 /// <summary>
 /// Close the dialog.
 /// </summary>
 private void Close(object sender, CancelEventArgs args)
 {
     Controller.WindowClosed();
     args.Cancel = true;
 }
Exemple #4
0
        public About() : base()
        {
            using (var a = new NSAutoreleasePool()) {
                SetFrame(new RectangleF(0, 0, 640, 281), true);
                Center();

                Delegate    = new AboutDelegate();
                StyleMask   = (NSWindowStyle.Closable | NSWindowStyle.Titled);
                Title       = string.Format(Properties_Resources.About, Properties_Resources.ApplicationName);
                MaxSize     = new SizeF(640, 281);
                MinSize     = new SizeF(640, 281);
                HasShadow   = true;
                BackingType = NSBackingStore.Buffered;

                this.website_link       = new CmisSyncLink(Properties_Resources.Website, Controller.WebsiteLinkAddress);
                this.website_link.Frame = new RectangleF(new PointF(295, 25), this.website_link.Frame.Size);

                this.credits_link       = new CmisSyncLink(Properties_Resources.Credits, Controller.CreditsLinkAddress);
                this.credits_link.Frame = new RectangleF(
                    new PointF(this.website_link.Frame.X + this.website_link.Frame.Width + 10, 25),
                    this.credits_link.Frame.Size);

                this.report_problem_link       = new CmisSyncLink(Properties_Resources.ReportProblem, Controller.ReportProblemLinkAddress);
                this.report_problem_link.Frame = new RectangleF(
                    new PointF(this.credits_link.Frame.X + this.credits_link.Frame.Width + 10, 25),
                    this.report_problem_link.Frame.Size);

                this.hidden_close_button = new NSButton()
                {
                    Frame = new RectangleF(0, 0, 0, 0),
                    KeyEquivalentModifierMask = NSEventModifierMask.CommandKeyMask,
                    KeyEquivalent             = "w"
                };

                this.hidden_close_button.Activated += delegate {
                    Controller.WindowClosed();
                };

                ContentView.AddSubview(this.hidden_close_button);

                CreateAbout();

                ContentView.AddSubview(this.website_link);
                ContentView.AddSubview(this.credits_link);
                ContentView.AddSubview(this.report_problem_link);
            }

            Controller.HideWindowEvent += delegate {
                using (var a = new NSAutoreleasePool()) {
                    InvokeOnMainThread(delegate {
                        PerformClose(this);
                    });
                }
            };

            Controller.ShowWindowEvent += delegate {
                using (var a = new NSAutoreleasePool()) {
                    InvokeOnMainThread(delegate {
                        OrderFrontRegardless();
                    });
                }
            };
        }