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
- Security.cs
- TreeViewAutomationPeer.cs
- Dynamic.cs
- HttpCapabilitiesSectionHandler.cs
- PagesSection.cs
- XmlNodeWriter.cs
- EntryPointNotFoundException.cs
- ActivitiesCollection.cs
- MetadataPropertyCollection.cs
- AppDomainManager.cs
- SpeechRecognitionEngine.cs
- WinEventHandler.cs
- AbstractExpressions.cs
- QilPatternFactory.cs
- GridItemPattern.cs
- CharConverter.cs
- RowVisual.cs
- CapabilitiesSection.cs
- GPRECT.cs
- BitmapPalette.cs
- DataGridViewRowsAddedEventArgs.cs
- GatewayDefinition.cs
- XmlSchemaSimpleContentExtension.cs
- SchemaElementDecl.cs
- XamlBuildProvider.cs
- DialogBaseForm.cs
- StreamGeometryContext.cs
- ConfigurationValue.cs
- AQNBuilder.cs
- MethodRental.cs
- EFColumnProvider.cs
- RequestQueue.cs
- InternalConfigHost.cs
- AutomationAttributeInfo.cs
- ScrollBar.cs
- pingexception.cs
- BaseTemplateParser.cs
- AppDomainManager.cs
- ValueConversionAttribute.cs
- LayoutInformation.cs
- ArgumentException.cs
- _HeaderInfoTable.cs
- MethodToken.cs
- BezierSegment.cs
- SoapUnknownHeader.cs
- NameTable.cs
- ProtocolViolationException.cs
- ArraySegment.cs
- InstancePersistenceCommand.cs
- BitmapFrameEncode.cs
- XmlEnumAttribute.cs
- SqlLiftIndependentRowExpressions.cs
- HtmlUtf8RawTextWriter.cs
- XmlCodeExporter.cs
- DataGridViewSelectedColumnCollection.cs
- LinkedResourceCollection.cs
- Rotation3DAnimationUsingKeyFrames.cs
- AssociativeAggregationOperator.cs
- CompilerState.cs
- WebProxyScriptElement.cs
- WindowsAuthenticationModule.cs
- XPathPatternParser.cs
- ClockController.cs
- TraceUtils.cs
- RequestQueue.cs
- ExpandedWrapper.cs
- DocumentationServerProtocol.cs
- SchemaComplexType.cs
- TypeLibConverter.cs
- ExpressionEditorAttribute.cs
- PerformanceCounterPermissionAttribute.cs
- sqlstateclientmanager.cs
- User.cs
- TextLineBreak.cs
- TextMarkerSource.cs
- MonitoringDescriptionAttribute.cs
- FusionWrap.cs
- OleDbCommand.cs
- TemplateLookupAction.cs
- AnyAllSearchOperator.cs
- DefaultConfirmation.cs
- TextTreeRootNode.cs
- InkCanvasSelectionAdorner.cs
- Command.cs
- ClientConfigPaths.cs
- PropertyOrder.cs
- DynamicDataResources.Designer.cs
- InstanceLockedException.cs
- XsltFunctions.cs
- ClientProxyGenerator.cs
- WebFormsRootDesigner.cs
- ReadWriteObjectLock.cs
- PenThread.cs
- CodeDirectoryCompiler.cs
- BooleanAnimationBase.cs
- TimeSpanConverter.cs
- ColumnTypeConverter.cs
- ResourceProviderFactory.cs
- BlurBitmapEffect.cs
- ImageUrlEditor.cs