From 1f85b0bb7efae475eaf73d7c682e2395f6f84e37 Mon Sep 17 00:00:00 2001 From: Curtis Wensley Date: Sun, 16 Feb 2020 17:50:19 -0800 Subject: [PATCH 1/4] Prevent StackOverflow when assigning a control as a child of itself --- src/Eto/Forms/Container.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Eto/Forms/Container.cs b/src/Eto/Forms/Container.cs index 7c3288463a..376fa14688 100644 --- a/src/Eto/Forms/Container.cs +++ b/src/Eto/Forms/Container.cs @@ -361,6 +361,10 @@ protected void RemoveLogicalParent(Control child) /// Previous child that the new child is replacing. protected void SetParent(Control child, Action assign = null, Control previousChild = null) { + if (ReferenceEquals(child, this)) + { + throw new InvalidOperationException("Cannot assign a control as a child of itself."); + } if (Handler is IThemedControlHandler) { if (!ReferenceEquals(previousChild, null)) @@ -374,7 +378,7 @@ protected void SetParent(Control child, Action assign = null, Control previousCh { #if DEBUG if (!ReferenceEquals(previousChild.VisualParent, this)) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "The previous child control is not a child of this container. Ensure you only remove children that you own.")); + throw new ArgumentException("The previous child control is not a child of this container. Ensure you only remove children that you own."); #endif if (!ReferenceEquals(previousChild.VisualParent, null)) From c8cc936c13e02c0f8ecde52597cc95d332215fba Mon Sep 17 00:00:00 2001 From: Curtis Wensley Date: Sun, 16 Feb 2020 17:51:43 -0800 Subject: [PATCH 2/4] Catch exceptions when setting designer content --- src/Addins/Eto.Designer/DesignPanel.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Addins/Eto.Designer/DesignPanel.cs b/src/Addins/Eto.Designer/DesignPanel.cs index 63102d7465..8f42151e9a 100644 --- a/src/Addins/Eto.Designer/DesignPanel.cs +++ b/src/Addins/Eto.Designer/DesignPanel.cs @@ -91,11 +91,19 @@ public static Control GetContent(Control content) void ControlCreatedInternal(Control control) { - ControlCreating?.Invoke(); - contentControl = control; - designSurface.Content = GetContent(control); - token = null; - ControlCreated?.Invoke(); + try + { + ControlCreating?.Invoke(); + contentControl = control; + designSurface.Content = GetContent(control); + token = null; + ControlCreated?.Invoke(); + } + catch (Exception ex) + { + designSurface.Content = null; + ErrorInternal(ex); + } } void ErrorInternal(Exception ex) From 174f483df8790441a2cdc6e37ed9ef3374b7f8ac Mon Sep 17 00:00:00 2001 From: Curtis Wensley Date: Sun, 16 Feb 2020 17:53:09 -0800 Subject: [PATCH 3/4] Update references - Portable.Xaml updated to 0.24.0 - Extended.Wpf.Toolkit updated to 3.6.0 (last commercial-friendly release) - NUnit updated to 3.12 --- .../Eto.Addin.VisualStudio/Eto.Addin.VisualStudio.csproj | 4 ++-- src/Eto.Serialization.Xaml/Eto.Serialization.Xaml.csproj | 2 +- src/Eto.Wpf/Eto.Wpf.csproj | 2 +- src/Eto/Eto.csproj | 2 +- test/Eto.Test.Gtk/Eto.Test.Gtk2.csproj | 2 +- test/Eto.Test.Gtk/Eto.Test.Gtk3.csproj | 2 +- test/Eto.Test.Mac/Eto.Test.Mac64.csproj | 8 ++++---- test/Eto.Test.Mac/Eto.Test.XamMac2.csproj | 2 +- test/Eto.Test.WinForms/Eto.Test.WinForms.csproj | 2 +- test/Eto.Test.Wpf/Eto.Test.Wpf.csproj | 2 +- test/Eto.Test/Eto.Test.csproj | 4 ++-- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Addins/Eto.Addin.VisualStudio/Eto.Addin.VisualStudio.csproj b/src/Addins/Eto.Addin.VisualStudio/Eto.Addin.VisualStudio.csproj index c8687a0168..f73e5cd28b 100755 --- a/src/Addins/Eto.Addin.VisualStudio/Eto.Addin.VisualStudio.csproj +++ b/src/Addins/Eto.Addin.VisualStudio/Eto.Addin.VisualStudio.csproj @@ -301,8 +301,8 @@ - - + + diff --git a/src/Eto.Serialization.Xaml/Eto.Serialization.Xaml.csproj b/src/Eto.Serialization.Xaml/Eto.Serialization.Xaml.csproj index dc0d0bae19..2296884cac 100644 --- a/src/Eto.Serialization.Xaml/Eto.Serialization.Xaml.csproj +++ b/src/Eto.Serialization.Xaml/Eto.Serialization.Xaml.csproj @@ -29,7 +29,7 @@ https://github.com/picoe/Eto/wiki - + diff --git a/src/Eto.Wpf/Eto.Wpf.csproj b/src/Eto.Wpf/Eto.Wpf.csproj index 410f5473da..fb761b6e7d 100644 --- a/src/Eto.Wpf/Eto.Wpf.csproj +++ b/src/Eto.Wpf/Eto.Wpf.csproj @@ -149,7 +149,7 @@ You do not need to use any of the classes of this assembly (unless customizing t - + diff --git a/src/Eto/Eto.csproj b/src/Eto/Eto.csproj index 6c188d2f4c..16f645a12c 100644 --- a/src/Eto/Eto.csproj +++ b/src/Eto/Eto.csproj @@ -49,6 +49,6 @@ https://github.com/picoe/Eto/wiki - + \ No newline at end of file diff --git a/test/Eto.Test.Gtk/Eto.Test.Gtk2.csproj b/test/Eto.Test.Gtk/Eto.Test.Gtk2.csproj index a8606dbf04..afc9c8d3af 100644 --- a/test/Eto.Test.Gtk/Eto.Test.Gtk2.csproj +++ b/test/Eto.Test.Gtk/Eto.Test.Gtk2.csproj @@ -44,7 +44,7 @@ - + \ No newline at end of file diff --git a/test/Eto.Test.Gtk/Eto.Test.Gtk3.csproj b/test/Eto.Test.Gtk/Eto.Test.Gtk3.csproj index 587ccbc07f..f8155ca810 100644 --- a/test/Eto.Test.Gtk/Eto.Test.Gtk3.csproj +++ b/test/Eto.Test.Gtk/Eto.Test.Gtk3.csproj @@ -55,7 +55,7 @@ - + \ No newline at end of file diff --git a/test/Eto.Test.Mac/Eto.Test.Mac64.csproj b/test/Eto.Test.Mac/Eto.Test.Mac64.csproj index 473e2ebf4c..40bbc12a3a 100644 --- a/test/Eto.Test.Mac/Eto.Test.Mac64.csproj +++ b/test/Eto.Test.Mac/Eto.Test.Mac64.csproj @@ -1,8 +1,8 @@ - + - + @@ -24,13 +24,13 @@ - + - + diff --git a/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj b/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj index ae81a9cdd9..576a007c8f 100644 --- a/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj +++ b/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj @@ -41,7 +41,7 @@ - + diff --git a/test/Eto.Test.WinForms/Eto.Test.WinForms.csproj b/test/Eto.Test.WinForms/Eto.Test.WinForms.csproj index 3601343cff..489c2828fd 100644 --- a/test/Eto.Test.WinForms/Eto.Test.WinForms.csproj +++ b/test/Eto.Test.WinForms/Eto.Test.WinForms.csproj @@ -54,7 +54,7 @@ - + diff --git a/test/Eto.Test.Wpf/Eto.Test.Wpf.csproj b/test/Eto.Test.Wpf/Eto.Test.Wpf.csproj index 2400b1e6cb..c899876308 100644 --- a/test/Eto.Test.Wpf/Eto.Test.Wpf.csproj +++ b/test/Eto.Test.Wpf/Eto.Test.Wpf.csproj @@ -62,7 +62,7 @@ - + diff --git a/test/Eto.Test/Eto.Test.csproj b/test/Eto.Test/Eto.Test.csproj index 33c9c0ef6a..aaf8cb3339 100644 --- a/test/Eto.Test/Eto.Test.csproj +++ b/test/Eto.Test/Eto.Test.csproj @@ -30,10 +30,10 @@ - + - + From 7c9418ba369eecf434d45acec15b2f828ac59851 Mon Sep 17 00:00:00 2001 From: Curtis Wensley Date: Mon, 17 Feb 2020 13:43:04 -0800 Subject: [PATCH 4/4] Fix issue including Eto.Forms.targets in nupkg --- src/Eto/Eto.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Eto/Eto.csproj b/src/Eto/Eto.csproj index 16f645a12c..be8154d907 100644 --- a/src/Eto/Eto.csproj +++ b/src/Eto/Eto.csproj @@ -40,7 +40,8 @@ https://github.com/picoe/Eto/wiki - + +