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 / XPathAncestorIterator.cs / 1 / XPathAncestorIterator.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; using System.Globalization; internal class XPathAncestorIterator: XPathAxisIterator { public XPathAncestorIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : base(nav, type, matchSelf) {} public XPathAncestorIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : base(nav, name, namespaceURI, matchSelf) {} public XPathAncestorIterator(XPathAncestorIterator other) : base(other) { } public override bool MoveNext() { if (first) { first = false; if(matchSelf && Matches) { position = 1; return true; } } while (nav.MoveToParent()) { if (Matches) { position ++; return true; } } return false; } public override XPathNodeIterator Clone() { return new XPathAncestorIterator(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; using System.Globalization; internal class XPathAncestorIterator: XPathAxisIterator { public XPathAncestorIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : base(nav, type, matchSelf) {} public XPathAncestorIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : base(nav, name, namespaceURI, matchSelf) {} public XPathAncestorIterator(XPathAncestorIterator other) : base(other) { } public override bool MoveNext() { if (first) { first = false; if(matchSelf && Matches) { position = 1; return true; } } while (nav.MoveToParent()) { if (Matches) { position ++; return true; } } return false; } public override XPathNodeIterator Clone() { return new XPathAncestorIterator(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
- FragmentQueryProcessor.cs
- IdentityNotMappedException.cs
- GPStream.cs
- PrintControllerWithStatusDialog.cs
- ItemsControlAutomationPeer.cs
- KeyPressEvent.cs
- ToolStripArrowRenderEventArgs.cs
- EventListener.cs
- CodeExporter.cs
- TemplateNodeContextMenu.cs
- CompModSwitches.cs
- SingleTagSectionHandler.cs
- SchemaAttDef.cs
- CssTextWriter.cs
- StoreItemCollection.cs
- VisualStyleTypesAndProperties.cs
- PartitionResolver.cs
- XmlSchemaAnnotation.cs
- FillErrorEventArgs.cs
- ObjectManager.cs
- TextEffect.cs
- ProxyWebPart.cs
- SystemIcmpV6Statistics.cs
- XmlSecureResolver.cs
- HtmlFormParameterReader.cs
- CounterNameConverter.cs
- DataObjectCopyingEventArgs.cs
- XmlSchemaComplexContentRestriction.cs
- _ProxyRegBlob.cs
- SecurityProtocolCorrelationState.cs
- GuidConverter.cs
- TagMapCollection.cs
- CookielessData.cs
- CharUnicodeInfo.cs
- ParallelTimeline.cs
- IdlingCommunicationPool.cs
- ILGenerator.cs
- ScriptServiceAttribute.cs
- IconConverter.cs
- DynamicRenderer.cs
- SRGSCompiler.cs
- AttributedMetaModel.cs
- Translator.cs
- ProgressiveCrcCalculatingStream.cs
- SqlStream.cs
- CryptoStream.cs
- TypeGenericEnumerableViewSchema.cs
- Item.cs
- HTMLTextWriter.cs
- SqlFacetAttribute.cs
- ProbeMatchesMessage11.cs
- PropertyConverter.cs
- ImmutablePropertyDescriptorGridEntry.cs
- ListItemsCollectionEditor.cs
- BoundingRectTracker.cs
- SplitterEvent.cs
- XmlSerializationWriter.cs
- Peer.cs
- FacetChecker.cs
- DataGridBoolColumn.cs
- XPathPatternBuilder.cs
- FactoryId.cs
- RegexTree.cs
- ReliableSessionBindingElement.cs
- XmlByteStreamReader.cs
- ExclusiveCanonicalizationTransform.cs
- InputLanguage.cs
- TextBlock.cs
- SoapAttributeOverrides.cs
- SmiRecordBuffer.cs
- SafeEventLogWriteHandle.cs
- TransformConverter.cs
- ConfigXmlElement.cs
- SelectionEditor.cs
- ComboBoxAutomationPeer.cs
- ForeignKeyConstraint.cs
- TimelineCollection.cs
- SynthesizerStateChangedEventArgs.cs
- Nodes.cs
- TextElementEditingBehaviorAttribute.cs
- CompositeDuplexBindingElement.cs
- PictureBox.cs
- HealthMonitoringSectionHelper.cs
- MappingMetadataHelper.cs
- SqlCacheDependencyDatabaseCollection.cs
- SystemNetworkInterface.cs
- PagesSection.cs
- ServerValidateEventArgs.cs
- QilScopedVisitor.cs
- XmlMtomReader.cs
- DataViewListener.cs
- ItemCheckedEvent.cs
- StylusPointPropertyId.cs
- MetadataCollection.cs
- FirstMatchCodeGroup.cs
- RuleSetCollection.cs
- FixedSOMFixedBlock.cs
- Scheduling.cs
- RemoteArgument.cs
- PageContentAsyncResult.cs