diff --git a/CSharp/V5/Libraries/UniversalEditor.Essential/Common/Reflection.cs b/CSharp/V5/Libraries/UniversalEditor.Essential/Common/Reflection.cs index 4ba3234e..1135a15b 100644 --- a/CSharp/V5/Libraries/UniversalEditor.Essential/Common/Reflection.cs +++ b/CSharp/V5/Libraries/UniversalEditor.Essential/Common/Reflection.cs @@ -31,7 +31,7 @@ namespace UniversalEditor.Common } private static Type[] mvarAvailableTypes = null; - public static Type[] GetAvailableTypes() + public static Type[] GetAvailableTypes(Type[] inheritsFrom = null) { if (mvarAvailableTypes == null) { @@ -56,6 +56,19 @@ namespace UniversalEditor.Common } mvarAvailableTypes = types; } + + if (inheritsFrom != null) + { + List retval = new List(); + foreach (Type tAvailable in mvarAvailableTypes) + { + foreach (Type tInheritsFrom in inheritsFrom) + { + if (tAvailable.IsSubclassOf(tInheritsFrom)) retval.Add(tAvailable); + } + } + return retval.ToArray(); + } return mvarAvailableTypes; } @@ -187,8 +200,10 @@ namespace UniversalEditor.Common XMLFileNames = System.IO.Directory.GetFiles(path, System.Configuration.ConfigurationManager.AppSettings["UniversalEditor.Configuration.ConfigurationFileNameFilter"], System.IO.SearchOption.AllDirectories); foreach (string fileName in XMLFileNames) { +#if !DEBUG try { +#endif string basePath = System.IO.Path.GetDirectoryName(fileName); UEPackageObjectModel mom = new UEPackageObjectModel(); @@ -202,10 +217,12 @@ namespace UniversalEditor.Common { listProjectTypes.Add(projtype); } +#if !DEBUG } catch { } +#endif } // ensure project types are loaded before running the next pass