Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / DescendantQuery.cs / 1305376 / DescendantQuery.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace MS.Internal.Xml.XPath { using System; using System.Xml; using System.Xml.XPath; using System.Diagnostics; internal class DescendantQuery : DescendantBaseQuery { XPathNodeIterator nodeIterator; internal DescendantQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type, bool matchSelf, bool abbrAxis) : base(qyParent, Name, Prefix, Type, matchSelf, abbrAxis) {} public DescendantQuery(DescendantQuery other) : base(other) { this.nodeIterator = Clone(other.nodeIterator); } public override void Reset() { nodeIterator = null; base.Reset(); } public override XPathNavigator Advance() { while (true) { if (nodeIterator == null) { position = 0; XPathNavigator nav = qyInput.Advance(); if (nav == null) { return null; } if (NameTest) { if (TypeTest == XPathNodeType.ProcessingInstruction) { nodeIterator = new IteratorFilter(nav.SelectDescendants(TypeTest, matchSelf), Name); } else { nodeIterator = nav.SelectDescendants(Name, Namespace, matchSelf); } } else { nodeIterator = nav.SelectDescendants(TypeTest, matchSelf); } } if (nodeIterator.MoveNext()) { position++; currentNode = nodeIterator.Current; return currentNode; } else { nodeIterator = null; } } } public override XPathNodeIterator Clone() { return new DescendantQuery(this); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace MS.Internal.Xml.XPath { using System; using System.Xml; using System.Xml.XPath; using System.Diagnostics; internal class DescendantQuery : DescendantBaseQuery { XPathNodeIterator nodeIterator; internal DescendantQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type, bool matchSelf, bool abbrAxis) : base(qyParent, Name, Prefix, Type, matchSelf, abbrAxis) {} public DescendantQuery(DescendantQuery other) : base(other) { this.nodeIterator = Clone(other.nodeIterator); } public override void Reset() { nodeIterator = null; base.Reset(); } public override XPathNavigator Advance() { while (true) { if (nodeIterator == null) { position = 0; XPathNavigator nav = qyInput.Advance(); if (nav == null) { return null; } if (NameTest) { if (TypeTest == XPathNodeType.ProcessingInstruction) { nodeIterator = new IteratorFilter(nav.SelectDescendants(TypeTest, matchSelf), Name); } else { nodeIterator = nav.SelectDescendants(Name, Namespace, matchSelf); } } else { nodeIterator = nav.SelectDescendants(TypeTest, matchSelf); } } if (nodeIterator.MoveNext()) { position++; currentNode = nodeIterator.Current; return currentNode; } else { nodeIterator = null; } } } public override XPathNodeIterator Clone() { return new DescendantQuery(this); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DbProviderConfigurationHandler.cs
- ContextBase.cs
- SignedXmlDebugLog.cs
- DelegatedStream.cs
- Configuration.cs
- WpfKnownMemberInvoker.cs
- BooleanSwitch.cs
- SslStream.cs
- XmlDictionaryReader.cs
- bindurihelper.cs
- SoundPlayer.cs
- HuffModule.cs
- XmlHelper.cs
- XPathBinder.cs
- AtlasWeb.Designer.cs
- _ProxyChain.cs
- ComponentDesigner.cs
- TrackingStringDictionary.cs
- XsdDateTime.cs
- TableProvider.cs
- EmptyReadOnlyDictionaryInternal.cs
- WinFormsSecurity.cs
- DefaultBindingPropertyAttribute.cs
- DataTableExtensions.cs
- LinqDataView.cs
- OdbcInfoMessageEvent.cs
- EraserBehavior.cs
- UpdateManifestForBrowserApplication.cs
- TextParagraph.cs
- SqlCacheDependencySection.cs
- HTTPRemotingHandler.cs
- QueryProcessor.cs
- BinaryReader.cs
- SchemaNamespaceManager.cs
- TextWriter.cs
- XmlDataLoader.cs
- BitStream.cs
- CustomAttributeFormatException.cs
- XmlNamespaceManager.cs
- FrameworkContentElement.cs
- ToolStripDropDownClosedEventArgs.cs
- PoisonMessageException.cs
- ListViewSortEventArgs.cs
- CompressEmulationStream.cs
- XmlSchemaSimpleType.cs
- ChannelEndpointElementCollection.cs
- InternalsVisibleToAttribute.cs
- BuildProviderUtils.cs
- RangeBaseAutomationPeer.cs
- X509ChainPolicy.cs
- XmlEncoding.cs
- QilReference.cs
- ControlParameter.cs
- FlowDocument.cs
- _BaseOverlappedAsyncResult.cs
- XmlSchemaExporter.cs
- PrivateFontCollection.cs
- PageCache.cs
- DrawingDrawingContext.cs
- OutputScopeManager.cs
- ContentOperations.cs
- SelectorAutomationPeer.cs
- RectAnimationBase.cs
- MonthCalendar.cs
- ColumnResizeUndoUnit.cs
- BindingContext.cs
- ProtocolViolationException.cs
- CodeCommentStatement.cs
- PageStatePersister.cs
- XmlSchemaAnyAttribute.cs
- LocalizableResourceBuilder.cs
- KeyedCollection.cs
- ValidateNames.cs
- WorkflowEventArgs.cs
- WebPartsPersonalizationAuthorization.cs
- Transform3DGroup.cs
- odbcmetadatacollectionnames.cs
- AutoSizeComboBox.cs
- ProviderCommandInfoUtils.cs
- DetailsViewCommandEventArgs.cs
- ServiceObjectContainer.cs
- DefaultIfEmptyQueryOperator.cs
- TypeSystem.cs
- TreeNodeCollection.cs
- Classification.cs
- Repeater.cs
- SizeF.cs
- MemberInitExpression.cs
- EntityDataSource.cs
- DataViewListener.cs
- SqlDataSourceSelectingEventArgs.cs
- TerminateSequenceResponse.cs
- StreamInfo.cs
- InstanceDataCollectionCollection.cs
- LineServicesCallbacks.cs
- xml.cs
- XmlReader.cs
- PolicyDesigner.cs
- SelectorAutomationPeer.cs
- MetadataItem.cs