File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
WpfDesign.Designer/Project/PropertyGrid/Editors Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,20 @@ public void LoadItemsCombobox()
116116
117117 private IEnumerable < Type > GetInheritedClasses ( Type type )
118118 {
119- return AppDomain . CurrentDomain . GetAssemblies ( ) . Where ( x => ! x . IsDynamic ) . SelectMany ( x => x . GetTypes ( ) . Where ( y => y . IsClass && ! y . IsAbstract && y . IsSubclassOf ( type ) ) ) ;
119+ return AppDomain . CurrentDomain . GetAssemblies ( ) . Where ( x => ! x . IsDynamic ) . SelectMany ( x => GetLoadableTypes ( x ) . Where ( y => y . IsClass && ! y . IsAbstract && y . IsSubclassOf ( type ) ) ) ;
120+ }
121+
122+ private IEnumerable < Type > GetLoadableTypes ( Assembly assembly )
123+ {
124+ if ( assembly == null ) throw new ArgumentNullException ( "assembly" ) ;
125+ try
126+ {
127+ return assembly . GetTypes ( ) ;
128+ }
129+ catch ( ReflectionTypeLoadException e )
130+ {
131+ return e . Types . Where ( t => t != null ) ;
132+ }
120133 }
121134
122135 private void OnAddItemClicked ( object sender , RoutedEventArgs e )
You can’t perform that action at this time.
0 commit comments