Inheritance: NSWindowDelegate
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 ()
        {
            using (var a = new NSAutoreleasePool ())
            {
                SetFrame (new RectangleF (0, 0, 640, 281), true);
                Center ();

                Delegate    = new AboutDelegate ();
                StyleMask   = (NSWindowStyle.Closable | NSWindowStyle.Titled);
                Title       = Properties_Resources.About;
                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 #3
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();
                    });
                }
            };
        }
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();
                    });
                }
            };
        }