From 1e1a4ec6336a102869fc4d7b6c3bd70af3f63365 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Tue, 4 Jan 2022 20:11:37 +0100 Subject: [PATCH 1/2] Update README --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 47e25de..6491722 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # WpfDesigner -The WPF Designer from SharpDevelop +The WPF Designer from SharpDevelop, available via [NuGet](https://www.nuget.org/packages/ICSharpCode.WpfDesigner/) ## Overview @@ -14,7 +14,7 @@ Branch | Status ## System Requirements -.NET 4.5 or Net Core 3.0 +.NET 4.5, or .NET Core 5.0 as well as .NET 6.0 ## Libraries and Integrated Tools @@ -22,10 +22,6 @@ Only the sample app has dependencies: * [Avalon Dock](http://avalondock.codeplex.com/) * [Avalon Edit](https://github.com/icsharpcode/AvalonEdit) -## Download - -[NuGet](https://www.nuget.org/packages/ICSharpCode.WpfDesigner/) - ## Sample App ![Sample App](/screenshot.png?raw=true "Sample App") From dc96001f38b232531cc1bb5d08d67dfddd56a77b Mon Sep 17 00:00:00 2001 From: MaxPatyk Date: Thu, 6 Jan 2022 13:52:40 +0100 Subject: [PATCH 2/2] Add exception for load assemblies. --- .../Editors/FlatCollectionEditor.xaml.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/WpfDesign.Designer/Project/PropertyGrid/Editors/FlatCollectionEditor.xaml.cs b/WpfDesign.Designer/Project/PropertyGrid/Editors/FlatCollectionEditor.xaml.cs index e1a9a57..1f20ecd 100644 --- a/WpfDesign.Designer/Project/PropertyGrid/Editors/FlatCollectionEditor.xaml.cs +++ b/WpfDesign.Designer/Project/PropertyGrid/Editors/FlatCollectionEditor.xaml.cs @@ -116,7 +116,20 @@ public void LoadItemsCombobox() private IEnumerable GetInheritedClasses(Type type) { - return AppDomain.CurrentDomain.GetAssemblies().Where(x => !x.IsDynamic).SelectMany(x => x.GetTypes().Where(y => y.IsClass && !y.IsAbstract && y.IsSubclassOf(type))); + return AppDomain.CurrentDomain.GetAssemblies().Where(x => !x.IsDynamic).SelectMany(x => GetLoadableTypes(x).Where(y => y.IsClass && !y.IsAbstract && y.IsSubclassOf(type))); + } + + private IEnumerable GetLoadableTypes(Assembly assembly) + { + if (assembly == null) throw new ArgumentNullException("assembly"); + try + { + return assembly.GetTypes(); + } + catch (ReflectionTypeLoadException e) + { + return e.Types.Where(t => t != null); + } } private void OnAddItemClicked(object sender, RoutedEventArgs e)