Пример #1
0
        private static ContainerXmlConfigElement ParseXmlConfiguration(string xml)
        {
            XmlSerializer ser          = new XmlSerializer(typeof(ContainerXmlConfigElement));
            StringReader  stringReader = new StringReader(xml);
            XmlSchema     schema       =
                XmlSchema.Read(
                    Assembly.GetExecutingAssembly().GetManifestResourceStream(
                        "ObjectBuilder.Samples.Configuration.ConfigXmlConfigElement.xsd"), null);
            XmlReaderSettings settings = new XmlReaderSettings();

            settings.ValidationType = ValidationType.Schema;
            settings.Schemas.Add(schema);
            XmlReader reader = XmlReader.Create(stringReader, settings);
            ContainerXmlConfigElement configData = (ContainerXmlConfigElement)ser.Deserialize(reader);

            return(configData);
        }
Пример #2
0
 public ContainerXmlConfig(string xml)
 {
     config = ParseXmlConfiguration(xml);
 }
Пример #3
0
        // Lifetime

        public ContainerXmlConfig(bool enableReflection)
        {
            config = new ContainerXmlConfigElement();
            config.EnableReflection = enableReflection;
        }