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
- DataGridViewRowsRemovedEventArgs.cs
- TemplateGroupCollection.cs
- LiteralControl.cs
- RenameRuleObjectDialog.Designer.cs
- ConfigurationManagerHelperFactory.cs
- ConditionCollection.cs
- Roles.cs
- TableCell.cs
- DrawingVisual.cs
- UserPersonalizationStateInfo.cs
- DataGridViewCellPaintingEventArgs.cs
- LogReservationCollection.cs
- PolygonHotSpot.cs
- DataBindingHandlerAttribute.cs
- BindingContext.cs
- SiteMapNodeItem.cs
- objectquery_tresulttype.cs
- Substitution.cs
- CompositeScriptReferenceEventArgs.cs
- StrongNameMembershipCondition.cs
- StylusButton.cs
- SmuggledIUnknown.cs
- Row.cs
- XmlSchemaAnnotated.cs
- KeyGestureValueSerializer.cs
- DrawingContextDrawingContextWalker.cs
- PrimaryKeyTypeConverter.cs
- NameSpaceEvent.cs
- AttributeTable.cs
- SafeSecurityHelper.cs
- ObjectQueryProvider.cs
- SuppressMessageAttribute.cs
- DesignSurfaceEvent.cs
- ListItemCollection.cs
- TTSEngineProxy.cs
- RayHitTestParameters.cs
- DetailsViewDeletedEventArgs.cs
- RootBrowserWindowProxy.cs
- Compilation.cs
- PackageDigitalSignatureManager.cs
- WebPartEditorOkVerb.cs
- TextBreakpoint.cs
- FlowNode.cs
- IDispatchConstantAttribute.cs
- ExceptionRoutedEventArgs.cs
- Matrix3DConverter.cs
- ZipPackage.cs
- TdsParserSafeHandles.cs
- PrintEvent.cs
- WebPartEditorCancelVerb.cs
- SqlGenerator.cs
- ImageField.cs
- LogicalExpr.cs
- PersonalizationProviderHelper.cs
- StatusStrip.cs
- SessionEndingCancelEventArgs.cs
- X509Certificate.cs
- Serializer.cs
- ProfilePropertySettings.cs
- SqlInternalConnection.cs
- CodeRegionDirective.cs
- ToolStripDropDownClosingEventArgs.cs
- Int32CAMarshaler.cs
- CompiledIdentityConstraint.cs
- FormViewCommandEventArgs.cs
- HtmlInputText.cs
- ResourceProviderFactory.cs
- WebContentFormatHelper.cs
- TextContainerHelper.cs
- ListViewTableRow.cs
- UriTemplateVariableQueryValue.cs
- NamespaceInfo.cs
- ValidationErrorEventArgs.cs
- HMACMD5.cs
- LinqDataSourceEditData.cs
- ForeignConstraint.cs
- XamlClipboardData.cs
- TraceHandlerErrorFormatter.cs
- Highlights.cs
- TextDecoration.cs
- WebContext.cs
- WebPartConnectVerb.cs
- FixedSOMGroup.cs
- TextServicesDisplayAttribute.cs
- MatrixValueSerializer.cs
- RelatedCurrencyManager.cs
- ReadOnlyAttribute.cs
- UnmanagedBitmapWrapper.cs
- KerberosTicketHashIdentifierClause.cs
- SafeEventLogReadHandle.cs
- TextDocumentView.cs
- CustomErrorsSection.cs
- XmlReaderSettings.cs
- ProviderCollection.cs
- ErrorLog.cs
- followingquery.cs
- HighlightComponent.cs
- CompositeScriptReference.cs
- RegisteredHiddenField.cs
- DataBinding.cs