public static Create ( |
||
portlet | ||
assembly | ||
return |
public static List <PortletInventoryItem> GetPortletsFromDll() { var portlets = new List <PortletInventoryItem>(); foreach (Assembly privateAssembly in TypeHandler.GetAssemblies()) { AssemblyName asmName = privateAssembly.GetName(); foreach (Type privateType in privateAssembly.GetTypes()) { PortletBase wp = null; if (privateType.BaseType != null) { if (privateType.IsSubclassOf(typeof(PortletBase)) && !privateType.IsAbstract && !privateType.IsNotPublic) { object instance = null; try { instance = Activator.CreateInstance(privateType); } catch (Exception e) //logged { Logger.WriteException(e); continue; } wp = (PortletBase)instance; } } if (wp != null) { portlets.Add(PortletInventoryItem.Create(wp, privateAssembly)); } } } return(portlets); }