Esempio n. 1
0
        public XPathMutableCursor(IXmlNode parent, CompiledXPath path,
                                  IXmlIncludedTypeMap knownTypes, IXmlNamespaceSource namespaces, CursorFlags flags)
            : base(path, namespaces, parent)
        {
            if (null == parent)
            {
                throw Error.ArgumentNull("parent");
            }
            if (null == path)
            {
                throw Error.ArgumentNull("path");
            }
            if (null == knownTypes)
            {
                throw Error.ArgumentNull("knownTypes");
            }
            if (!path.IsCreatable)
            {
                throw Error.XPathNotCreatable(path);
            }

            this.step       = path.FirstStep;
            this.knownTypes = knownTypes;
            this.flags      = flags;

            var source = parent.RequireRealizable <XPathNavigator>();

            if (source.IsReal)
            {
                iterator = new XPathBufferedNodeIterator(
                    source.Value.Select(path.FirstStep.Path));
            }
        }
Esempio n. 2
0
        public XPathReadOnlyCursor(
            IXmlNode parent,
            CompiledXPath path,
            IXmlIncludedTypeMap includedTypes,
            IXmlNamespaceSource namespaces,
            CursorFlags flags
            ) : base(path, namespaces, parent)
        {
            if (parent == null)
            {
                throw Error.ArgumentNull(nameof(parent));
            }
            if (path == null)
            {
                throw Error.ArgumentNull(nameof(path));
            }
            if (includedTypes == null)
            {
                throw Error.ArgumentNull(nameof(includedTypes));
            }

            this.includedTypes = includedTypes;
            this.flags         = flags;

            Reset();
        }
Esempio n. 3
0
 public IXmlCursor Select(
     CompiledXPath path,
     IXmlIncludedTypeMap knownTypes,
     IXmlNamespaceSource namespaces,
     CursorFlags flags
     )
 {
     return(node.Select(path, knownTypes, namespaces, flags));
 }
Esempio n. 4
0
 public IXmlCursor Select(
     CompiledXPath path,
     IXmlIncludedTypeMap includedTypes,
     IXmlNamespaceSource namespaces,
     CursorFlags flags
     )
 {
     throw new NotImplementedException();
 }
        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. 6
0
 public IXmlCursor Select(
     CompiledXPath path,
     IXmlIncludedTypeMap includedTypes,
     IXmlNamespaceSource namespaces,
     CursorFlags flags
     )
 {
     return(flags.SupportsMutation()
       ? (IXmlCursor) new XPathMutableCursor(this, path, includedTypes, namespaces, flags)
       : (IXmlCursor) new XPathReadOnlyCursor(this, path, includedTypes, namespaces, flags));
 }
Esempio n. 7
0
 protected override IXmlCursor Cursor(
     IXmlNode parent,
     CompiledXPath path,
     IXmlIncludedTypeMap includedTypes,
     CursorFlags flags
     )
 {
     return(new XPathReadOnlyCursor(
                parent,
                path,
                includedTypes,
                NamespaceSource.Instance,
                flags
                ));
 }
		public XPathReadOnlyCursor(IXmlNode parent, CompiledXPath path,
			IXmlIncludedTypeMap includedTypes, IXmlNamespaceSource namespaces, CursorFlags flags)
			: base(path, namespaces, parent)
		{
			if (parent == null)
				throw Error.ArgumentNull("parent");
			if (path == null)
				throw Error.ArgumentNull("path");
			if (includedTypes == null)
				throw Error.ArgumentNull("includedTypes");

			this.includedTypes = includedTypes;
			this.flags         = flags;

			Reset();
		}
Esempio n. 9
0
		public XPathMutableCursor(IXmlNode parent, CompiledXPath path,
			IXmlIncludedTypeMap knownTypes, IXmlNamespaceSource namespaces, CursorFlags flags)
			: base(path, namespaces, parent)
		{
			if (null == parent)
				throw Error.ArgumentNull("parent");
			if (null == path)
				throw Error.ArgumentNull("path");
			if (null == knownTypes)
				throw Error.ArgumentNull("knownTypes");
			if (!path.IsCreatable)
				throw Error.XPathNotCreatable(path);

			this.step       = path.FirstStep;
			this.knownTypes = knownTypes;
			this.flags      = flags;

			var source = parent.RequireRealizable<XPathNavigator>();
			if (source.IsReal)
				iterator = new XPathBufferedNodeIterator(
					source.Value.Select(path.FirstStep.Path));
		}
Esempio n. 10
0
		protected override IXmlCursor Cursor(IXmlNode parent, CompiledXPath path, IXmlIncludedTypeMap includedTypes, CursorFlags flags)
		{
			return new XPathMutableCursor(parent, path, includedTypes, NamespaceSource.Instance, flags);
		}
Esempio n. 11
0
 protected abstract IXmlCursor Cursor(
     IXmlNode parent,
     CompiledXPath path,
     IXmlIncludedTypeMap includedTypes,
     CursorFlags flags
     );
Esempio n. 12
0
		protected abstract IXmlCursor Cursor(IXmlNode parent, CompiledXPath path, IXmlIncludedTypeMap includedTypes, CursorFlags flags);