public void ProcessCustomAttributeGroups() { var attributeGroupTypes = new List <Type>(); var assemblies = XmlLayoutUtilities.GetAssemblyNames(); var customXmlAttributeType = typeof(CustomXmlAttributeGroup); foreach (var assembly in assemblies) { attributeGroupTypes.AddRange(Assembly.Load(assembly) .GetTypes() .Where(t => !t.IsAbstract && t.IsSubclassOf(customXmlAttributeType)) .ToList()); } // validate and filter out any invalid entries foreach (var attributeGroupType in attributeGroupTypes) { //var instance = (CustomXmlAttributeGroup)Activator.CreateInstance(attributeGroupType);\ var instance = GetTestInstance <CustomXmlAttributeGroup>(attributeGroupType); if (instance.Validate()) { this.customAttributeGroupsToAdd.Add(instance); } } }
static void LoadAssemblies() { assemblies = XmlLayoutUtilities.GetAssemblyNames() .Select(an => Assembly.Load(an)) .ToList(); }