public static IXmlIncludedType Require(this IXmlIncludedTypeMap includedTypes, Type clrType)
        {
            IXmlIncludedType includedType;

            if (includedTypes.TryGet(clrType, out includedType))
            {
                return(includedType);
            }

            throw Error.NotXmlKnownType(clrType);
        }
Esempio n. 2
0
        private bool SetAtNext()
        {
            node = iterator.Current;

            IXmlIncludedType includedType;

            if (!includedTypes.TryGet(XsiType, out includedType))
            {
                return(false);
            }

            type = includedType.ClrType;
            return(true);
        }
Esempio n. 3
0
        private bool SeekCurrent()
        {
            while (depth < xpath.Depth)
            {
                var iterator = node.Select(step.Path);
                if (!iterator.MoveNext())
                {
                    return(true); // Sought as far as possible
                }
                if (!Consume(iterator, false))
                {
                    return(false); // Problem: found multiple nodes
                }
            }

            IXmlIncludedType includedType;

            if (!knownTypes.TryGet(XsiType, out includedType))
            {
                return(false); // Problem: unrecognized xsi:type
            }
            type = includedType.ClrType;
            return(true); // Sought all the way
        }