Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Xml / System / Xml / XPath / Internal / DescendantQuery.cs / 1 / 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
- ConfigPathUtility.cs
- PrintControllerWithStatusDialog.cs
- InternalMappingException.cs
- DeflateStream.cs
- WasHttpHandlersInstallComponent.cs
- CodeSnippetStatement.cs
- ListBox.cs
- Avt.cs
- ErrorHandler.cs
- XmlSchemaAnnotated.cs
- BinaryKeyIdentifierClause.cs
- ReversePositionQuery.cs
- DataGridViewAdvancedBorderStyle.cs
- WmlPageAdapter.cs
- RedirectionProxy.cs
- ConstraintEnumerator.cs
- SapiGrammar.cs
- MailAddressCollection.cs
- MemberRestriction.cs
- WindowsFormsHostPropertyMap.cs
- HitTestResult.cs
- ColorTranslator.cs
- InputLanguageManager.cs
- CounterSetInstanceCounterDataSet.cs
- SQLRoleProvider.cs
- HttpApplication.cs
- XmlSchemaGroup.cs
- PerfCounterSection.cs
- SiteMapSection.cs
- TimelineGroup.cs
- XmlParser.cs
- Timer.cs
- Config.cs
- WebPartCancelEventArgs.cs
- HtmlAnchor.cs
- DatagridviewDisplayedBandsData.cs
- MetadataItemSerializer.cs
- FunctionDescription.cs
- DataGridViewColumnHeaderCell.cs
- Msec.cs
- Brush.cs
- XmlDownloadManager.cs
- XmlLangPropertyAttribute.cs
- ComponentResourceKeyConverter.cs
- ObjectReaderCompiler.cs
- LinearGradientBrush.cs
- JournalEntryStack.cs
- SdlChannelSink.cs
- DataGridViewColumn.cs
- UnmanagedMemoryAccessor.cs
- PersianCalendar.cs
- SByteConverter.cs
- FixedSOMTableCell.cs
- FolderLevelBuildProvider.cs
- WindowsGraphics.cs
- QueryCoreOp.cs
- LayoutEvent.cs
- Evidence.cs
- XmlProcessingInstruction.cs
- FtpCachePolicyElement.cs
- DateTimeFormatInfoScanner.cs
- EventManager.cs
- SelectionItemProviderWrapper.cs
- ReaderWriterLockWrapper.cs
- Light.cs
- DataGridViewCellCancelEventArgs.cs
- DiscreteKeyFrames.cs
- FileDialog_Vista.cs
- StylusPlugInCollection.cs
- PartBasedPackageProperties.cs
- CqlLexer.cs
- __ComObject.cs
- Pens.cs
- metadatamappinghashervisitor.cs
- ClientUrlResolverWrapper.cs
- RichTextBox.cs
- Trace.cs
- LogExtent.cs
- TemplatePropertyEntry.cs
- PropertyEmitterBase.cs
- ProgressBarBrushConverter.cs
- OrthographicCamera.cs
- PropertyMetadata.cs
- TextTreeDeleteContentUndoUnit.cs
- _HelperAsyncResults.cs
- PrintDialogException.cs
- PngBitmapEncoder.cs
- ListBoxAutomationPeer.cs
- CancellationScope.cs
- _Semaphore.cs
- TransformerTypeCollection.cs
- EnterpriseServicesHelper.cs
- MatrixCamera.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- LabelLiteral.cs
- TreeNodeStyle.cs
- Resources.Designer.cs
- DeflateStream.cs
- ImageIndexConverter.cs
- ItemsControl.cs