public ExtensibleXmlResourceResolver() { var _container = PluginContainer.GetOvalCompositionContainer(); SchemaResolvers = _container.GetExportedValues <IOvalSchemaResolver>(); //SchemaResolvers.Add(new OvalVersion59SchemaResolver()); }
public ExtensibleXmlResourceResolver() { var _container = PluginContainer.GetOvalCompositionContainer(); SchemaResolvers = _container.GetExportedValues <IOvalSchemaResolver>() .OrderBy(x => x.GetType().Name) .ToList(); }
public static XmlAttributeOverrides GetExportedDefinitionsOverrides(XmlAttributeOverrides DefinitionsOverrides) { var _container = PluginContainer.GetOvalCompositionContainer(); var testTypes = _container.GetExports <TestType>().Select(exp => exp.Value.GetType()); var objectTypes = _container.GetExports <ObjectType>().Select(exp => exp.Value.GetType()); var stateTypes = _container.GetExports <StateType>().Select(exp => exp.Value.GetType()); XmlAttributes testAttributes = new XmlAttributes(); foreach (var testType in testTypes) { var xmlAttrs = (testType.GetCustomAttributes(typeof(XmlRootAttribute), false) as XmlRootAttribute[]).SingleOrDefault(); testAttributes.XmlArrayItems.Add(new XmlArrayItemAttribute(xmlAttrs.ElementName, testType) { Namespace = xmlAttrs.Namespace }); } DefinitionsOverrides.Add(typeof(oval_definitions), "tests", testAttributes); XmlAttributes objectAttributes = new XmlAttributes(); foreach (var objectType in objectTypes) { var xmlAttrs = (objectType.GetCustomAttributes(typeof(XmlRootAttribute), false) as XmlRootAttribute[]).SingleOrDefault(); objectAttributes.XmlArrayItems.Add(new XmlArrayItemAttribute(xmlAttrs.ElementName, objectType) { Namespace = xmlAttrs.Namespace }); } DefinitionsOverrides.Add(typeof(oval_definitions), "objects", objectAttributes); XmlAttributes stateAttributes = new XmlAttributes(); foreach (var stateType in stateTypes) { var xmlAttrs = (stateType.GetCustomAttributes(typeof(XmlRootAttribute), false) as XmlRootAttribute[]).SingleOrDefault(); stateAttributes.XmlArrayItems.Add(new XmlArrayItemAttribute(xmlAttrs.ElementName, stateType) { Namespace = xmlAttrs.Namespace }); } DefinitionsOverrides.Add(typeof(oval_definitions), "states", stateAttributes); return(DefinitionsOverrides); }
public static XmlAttributeOverrides GetExportedScOverrides() { var _container = PluginContainer.GetOvalCompositionContainer(); var itemTypes = _container.GetExports <ItemType>().Select(exp => exp.Value.GetType()); XmlAttributeOverrides scOverrides = new XmlAttributeOverrides(); XmlAttributes itemAttributes = new XmlAttributes(); foreach (var itemType in itemTypes) { var xmlAttrs = (itemType.GetCustomAttributes(typeof(XmlRootAttribute), false) as XmlRootAttribute[]).SingleOrDefault(); itemAttributes.XmlArrayItems.Add(new XmlArrayItemAttribute(xmlAttrs.ElementName, itemType) { Namespace = xmlAttrs.Namespace }); } scOverrides.Add(typeof(oval_system_characteristics), "system_data", itemAttributes); return(scOverrides); }