public static List <NodeCatalogItem> CreateItemsForTypes(IEnumerable <Type> types) { var catalogItems = new List <NodeCatalogItem>(); foreach (var nodeType in types) { // The node needs an valid constructor, otherwise the factory can't create an instance if (!TypeUtility.CanCreateTreeNodeInstance(nodeType)) { continue; } var infoAttribute = TypeUtility.GetAttributeFromTypeOrInterface <NodeCatalogInfoAttribute>(nodeType); var itemName = infoAttribute?.Name ?? TypeUtility.GetTypeDisplayName(nodeType); var itemCategory = infoAttribute?.Category ?? itemName; var itemDescription = infoAttribute?.Description ?? itemName; catalogItems.Add(new NodeCatalogItem(itemName, itemCategory, itemDescription, nodeType)); } return(catalogItems); }