예제 #1
0
        public XamlXmlParser(XmlReader xmlReader, XamlSchemaContext schemaContext, XamlXmlReaderSettings settings)
        {
            if (xmlReader == null)
            {
                throw new ArgumentNullException("xmlReader");
            }
            if (schemaContext == null)
            {
                throw new ArgumentNullException("schemaContext");
            }

            sctx          = schemaContext;
            this.settings = settings ?? new XamlXmlReaderSettings();

            // filter out some nodes.
            var xrs = new XmlReaderSettings()
            {
                CloseInput     = this.settings.CloseInput,
                IgnoreComments = true,
                IgnoreProcessingInstructions = true,
                IgnoreWhitespace             = true
            };

            r         = XmlReader.Create(xmlReader, xrs);
            line_info = r as IXmlLineInfo;
            xaml_namespace_resolver = new NamespaceResolver(r as IXmlNamespaceResolver);
        }
예제 #2
0
        public XamlXmlParser(XmlReader xmlReader, XamlSchemaContext schemaContext, XamlXmlReaderSettings settings)
        {
            if (xmlReader == null)
            {
                throw new ArgumentNullException(nameof(xmlReader));
            }
            if (schemaContext == null)
            {
                throw new ArgumentNullException(nameof(schemaContext));
            }

            sctx          = schemaContext;
            this.settings = settings ?? default_settings;

            r         = xmlReader;
            line_info = r as IXmlLineInfo;
            xaml_namespace_resolver = new NamespaceResolver(r as IXmlNamespaceResolver);
        }
 public ValueSerializerContext(PrefixLookup prefixLookup, XamlSchemaContext schemaContext, IAmbientProvider ambientProvider, IProvideValueTarget provideValue, IRootObjectProvider rootProvider, IDestinationTypeProvider destinationProvider)
 {
     if (prefixLookup == null)
     {
         throw new ArgumentNullException("prefixLookup");
     }
     if (schemaContext == null)
     {
         throw new ArgumentNullException("schemaContext");
     }
     prefix_lookup      = prefixLookup;
     namespace_resolver = new NamespaceResolver(prefix_lookup.Namespaces);
     type_resolver      = new XamlTypeResolver(namespace_resolver, schemaContext);
     sctx                     = schemaContext;
     ambient_provider         = ambientProvider;
     this.provideValue        = provideValue;
     this.rootProvider        = rootProvider;
     this.destinationProvider = destinationProvider;
 }
예제 #4
0
        public XamlXmlParser(XmlReader xmlReader, XamlSchemaContext schemaContext, XamlXmlReaderSettings settings)
        {
            if (xmlReader == null)
            {
                throw new ArgumentNullException(nameof(xmlReader));
            }
            if (schemaContext == null)
            {
                throw new ArgumentNullException(nameof(schemaContext));
            }

            sctx          = schemaContext;
            this.settings = settings ?? default_settings;
            if (settings?.SkipXmlCompatibilityProcessing != true)
            {
                xmlReader = new CompatibleXmlReader(xmlReader, schemaContext);
            }

            r         = xmlReader;
            line_info = r as IXmlLineInfo;
            xaml_namespace_resolver = new NamespaceResolver(r as IXmlNamespaceResolver);
        }
 public XamlTypeResolver(NamespaceResolver namespaceResolver, XamlSchemaContext schemaContext)
 {
     ns_resolver    = namespaceResolver;
     schema_context = schemaContext;
 }