Beispiel #1
0
        public ExtensibleXmlResourceResolver()
        {
            var _container = PluginContainer.GetOvalCompositionContainer();

            SchemaResolvers = _container.GetExportedValues <IOvalSchemaResolver>();
            //SchemaResolvers.Add(new OvalVersion59SchemaResolver());
        }
Beispiel #2
0
        public ExtensibleXmlResourceResolver()
        {
            var _container = PluginContainer.GetOvalCompositionContainer();

            SchemaResolvers = _container.GetExportedValues <IOvalSchemaResolver>()
                              .OrderBy(x => x.GetType().Name)
                              .ToList();
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }