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
- TreeWalkHelper.cs
- PrintEvent.cs
- RangeValidator.cs
- TextFormatterHost.cs
- Process.cs
- SerialErrors.cs
- FormViewUpdatedEventArgs.cs
- PrintDialog.cs
- CustomPopupPlacement.cs
- QilList.cs
- MemberHolder.cs
- OleDbInfoMessageEvent.cs
- IdleTimeoutMonitor.cs
- MessageSmuggler.cs
- ObservableCollection.cs
- MetaData.cs
- RegexCompilationInfo.cs
- ScrollEvent.cs
- EllipticalNodeOperations.cs
- EUCJPEncoding.cs
- CacheChildrenQuery.cs
- SiteMapHierarchicalDataSourceView.cs
- SignedXml.cs
- XmlBufferReader.cs
- SoapSchemaImporter.cs
- _SSPIWrapper.cs
- QilUnary.cs
- NumberEdit.cs
- StreamGeometry.cs
- DrawingAttributeSerializer.cs
- VariableAction.cs
- ObjectTypeMapping.cs
- InkCollectionBehavior.cs
- XhtmlBasicImageAdapter.cs
- DeclarationUpdate.cs
- Int64Storage.cs
- LineSegment.cs
- UriScheme.cs
- HwndAppCommandInputProvider.cs
- PropagationProtocolsTracing.cs
- DesignerSelectionListAdapter.cs
- METAHEADER.cs
- SqlBuffer.cs
- BaseHashHelper.cs
- EdmEntityTypeAttribute.cs
- CodeDesigner.cs
- DefaultHttpHandler.cs
- BitmapEffect.cs
- DataGridViewBand.cs
- FormatterConverter.cs
- HwndHostAutomationPeer.cs
- DragEventArgs.cs
- WebPartVerb.cs
- PrivateFontCollection.cs
- MultipleViewProviderWrapper.cs
- AudioFormatConverter.cs
- WebChannelFactory.cs
- PingOptions.cs
- WindowPatternIdentifiers.cs
- PackageStore.cs
- CapabilitiesSection.cs
- Int64Storage.cs
- peernodestatemanager.cs
- PointLightBase.cs
- EditorZoneBase.cs
- TextViewSelectionProcessor.cs
- ClassHandlersStore.cs
- UnsafeNativeMethods.cs
- ListViewContainer.cs
- EdmError.cs
- DesignerVerbCollection.cs
- UserUseLicenseDictionaryLoader.cs
- CodeConstructor.cs
- ListControlConvertEventArgs.cs
- AtomEntry.cs
- RouteItem.cs
- ClassValidator.cs
- ContractReference.cs
- _DisconnectOverlappedAsyncResult.cs
- SmiGettersStream.cs
- PropertyMap.cs
- MgmtConfigurationRecord.cs
- WebProxyScriptElement.cs
- DateTimeFormatInfo.cs
- EpmTargetPathSegment.cs
- Translator.cs
- ProxyElement.cs
- GridItem.cs
- WorkflowInspectionServices.cs
- CodeActivity.cs
- ProviderBase.cs
- BamlResourceContent.cs
- DataRowView.cs
- ToolBarPanel.cs
- _ConnectionGroup.cs
- NominalTypeEliminator.cs
- MultipleViewPatternIdentifiers.cs
- MethodBuilderInstantiation.cs
- Int32RectValueSerializer.cs
- LoginUtil.cs