Exemple #1
0
        protected override IFormatReaderContext Create(XmlNameTable parameter)
        {
            var context = _contexts.Get(parameter);
            var mapper  = new IdentityMapper(_store, context.NamespaceManager);

            var reflector = new TypePartReflector(mapper, _types);
            var types     = new TypeParser(reflector);
            var parser    = new ReflectionParser(types, reflector);
            var result    = new FormatReaderContext(mapper, parser, mapper);

            return(result);
        }
Exemple #2
0
        protected override IFormatReaderContext Create(System.Xml.XmlReader parameter)
        {
            var resolver = _contexts.IsSatisfiedBy(parameter.NameTable)
                                               ? _contexts.Get(parameter.NameTable)
                           .NamespaceManager
                                               : parameter as IXmlNamespaceResolver ?? Default(parameter);
            var mapper = new IdentityMapper(_store, resolver);

            var reflector = new TypePartReflector(mapper, _types);
            var types     = new TypeParser(reflector);
            var parser    = new ReflectionParser(types, reflector);
            var result    = new FormatReaderContext(mapper, parser);

            return(result);
        }
Exemple #3
0
 IXmlNamespaceResolver Determine(System.Xml.XmlReader parameter)
 => parameter.NameTable != null && _contexts.IsSatisfiedBy(parameter.NameTable)
                            ? _contexts.Get(parameter.NameTable).NamespaceManager
                            : null;