示例#1
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);
        }
示例#2
0
 IXmlNamespaceResolver Determine(System.Xml.XmlReader parameter)
 => parameter.NameTable != null && _contexts.IsSatisfiedBy(parameter.NameTable)
                            ? _contexts.Get(parameter.NameTable).NamespaceManager
                            : null;