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
- Point3DCollection.cs
- XpsS0ValidatingLoader.cs
- TreeViewItem.cs
- UserPreferenceChangingEventArgs.cs
- Int64Animation.cs
- odbcmetadatacolumnnames.cs
- NumericUpDown.cs
- SystemNetworkInterface.cs
- UnsafeMethods.cs
- ChildrenQuery.cs
- M3DUtil.cs
- WmlFormAdapter.cs
- XmlUtil.cs
- PerformanceCounterCategory.cs
- HttpListenerPrefixCollection.cs
- SystemIPAddressInformation.cs
- SqlDataAdapter.cs
- RefreshPropertiesAttribute.cs
- AuthStoreRoleProvider.cs
- WebFaultClientMessageInspector.cs
- AspNetCompatibilityRequirementsMode.cs
- FactoryId.cs
- TraceProvider.cs
- AdPostCacheSubstitution.cs
- ProcessThread.cs
- PeerNameRecordCollection.cs
- TextServicesCompartmentContext.cs
- Soap.cs
- UnionExpr.cs
- EffectiveValueEntry.cs
- externdll.cs
- MessageQueue.cs
- TextSelectionProcessor.cs
- TabControl.cs
- WindowsToolbar.cs
- Matrix3DValueSerializer.cs
- TraceContext.cs
- DbProviderServices.cs
- XmlSchemaChoice.cs
- DataColumn.cs
- MultipartContentParser.cs
- OrderedDictionary.cs
- SchemaLookupTable.cs
- ImmComposition.cs
- ScriptResourceAttribute.cs
- WindowsListView.cs
- isolationinterop.cs
- BitmapCache.cs
- LocalValueEnumerator.cs
- SessionState.cs
- ScriptControl.cs
- TextTreeNode.cs
- XmlSchemaCollection.cs
- GeometryCollection.cs
- ContentOperations.cs
- ReflectTypeDescriptionProvider.cs
- MenuEventArgs.cs
- SQLResource.cs
- ExpandedProjectionNode.cs
- XMLDiffLoader.cs
- safesecurityhelperavalon.cs
- XmlTextReaderImpl.cs
- Constants.cs
- Marshal.cs
- Delegate.cs
- CollectionMarkupSerializer.cs
- TextContainerChangedEventArgs.cs
- BindableAttribute.cs
- DBConcurrencyException.cs
- ReflectionPermission.cs
- DrawTreeNodeEventArgs.cs
- CodeBlockBuilder.cs
- MainMenu.cs
- unitconverter.cs
- ChannelBase.cs
- RC2.cs
- RuleSettingsCollection.cs
- ProfessionalColors.cs
- __FastResourceComparer.cs
- PageVisual.cs
- SafeRegistryHandle.cs
- GradientStop.cs
- SchemaTableOptionalColumn.cs
- GC.cs
- InsufficientMemoryException.cs
- DispatchChannelSink.cs
- MergeFilterQuery.cs
- IssuerInformation.cs
- hresults.cs
- XmlArrayItemAttribute.cs
- TextViewBase.cs
- WebPartEditorApplyVerb.cs
- ExecutedRoutedEventArgs.cs
- TextEditorLists.cs
- PartialCachingAttribute.cs
- XPathAncestorQuery.cs
- DoubleCollection.cs
- AssemblyNameProxy.cs
- ListSourceHelper.cs
- SettingsContext.cs