Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- MembershipUser.cs
- AdapterDictionary.cs
- AccessKeyManager.cs
- ToolStripItemClickedEventArgs.cs
- SqlExpressionNullability.cs
- GridView.cs
- PointLight.cs
- HostedAspNetEnvironment.cs
- ComponentResourceKeyConverter.cs
- SingleTagSectionHandler.cs
- ClientConvert.cs
- EDesignUtil.cs
- OneToOneMappingSerializer.cs
- LineSegment.cs
- _ContextAwareResult.cs
- CompositionAdorner.cs
- DataGridTable.cs
- ControlTemplate.cs
- GacUtil.cs
- Thread.cs
- TreeViewItem.cs
- CodeExpressionCollection.cs
- DictionaryContent.cs
- DropDownList.cs
- WebBrowserBase.cs
- MethodToken.cs
- TypeDelegator.cs
- SingleObjectCollection.cs
- FileUpload.cs
- ExitEventArgs.cs
- BindingCompleteEventArgs.cs
- Timeline.cs
- SingleTagSectionHandler.cs
- SchemaContext.cs
- EditorPart.cs
- ISSmlParser.cs
- X509Certificate.cs
- Lasso.cs
- InstanceKeyCollisionException.cs
- CodeCastExpression.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- FixedStringLookup.cs
- CodeThrowExceptionStatement.cs
- Vector3DCollection.cs
- SourceLineInfo.cs
- RequestCachePolicy.cs
- SamlAdvice.cs
- DataGridViewRowsRemovedEventArgs.cs
- ReflectPropertyDescriptor.cs
- ResourceDisplayNameAttribute.cs
- DataGridColumnCollection.cs
- XPathBuilder.cs
- _NegoStream.cs
- CommonObjectSecurity.cs
- AuthenticateEventArgs.cs
- MediaEntryAttribute.cs
- ToolStripContentPanelRenderEventArgs.cs
- GeneralTransform.cs
- WindowsIPAddress.cs
- TextDecorationCollection.cs
- SchemaImporterExtensionElement.cs
- CopyAttributesAction.cs
- SystemIPInterfaceProperties.cs
- RegexGroupCollection.cs
- PersonalizablePropertyEntry.cs
- XPathNodeList.cs
- XmlAttributeOverrides.cs
- VectorValueSerializer.cs
- SymbolDocumentGenerator.cs
- _DomainName.cs
- AccessibleObject.cs
- ObjectAnimationBase.cs
- SessionPageStatePersister.cs
- EraserBehavior.cs
- SQLDecimalStorage.cs
- DocumentsTrace.cs
- DataErrorValidationRule.cs
- ReadWriteObjectLock.cs
- DynamicQueryableWrapper.cs
- DBNull.cs
- Comparer.cs
- OracleColumn.cs
- log.cs
- OptimizerPatterns.cs
- Canvas.cs
- HttpCachePolicyElement.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- FindSimilarActivitiesVerb.cs
- DataReceivedEventArgs.cs
- Variant.cs
- CipherData.cs
- MULTI_QI.cs
- ValueConversionAttribute.cs
- ObjectDataSourceFilteringEventArgs.cs
- ModelFunction.cs
- AuthenticationConfig.cs
- ProtocolsConfigurationEntry.cs
- Types.cs
- QilExpression.cs
- SpeechRecognizer.cs