Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathAncestorIterator.cs / 1305376 / 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
- OuterGlowBitmapEffect.cs
- ResourcesBuildProvider.cs
- WebBrowserDesigner.cs
- TaiwanCalendar.cs
- SiteMapSection.cs
- TabletDevice.cs
- SqlMethodTransformer.cs
- SqlServices.cs
- XmlParserContext.cs
- OdbcTransaction.cs
- BinaryObjectWriter.cs
- WebPartManager.cs
- Select.cs
- UrlMappingsModule.cs
- AnnotationAdorner.cs
- GPPOINT.cs
- ToolStripPanel.cs
- RegexMatchCollection.cs
- DispatcherProcessingDisabled.cs
- Literal.cs
- XsltLibrary.cs
- RequestUriProcessor.cs
- OleDbCommandBuilder.cs
- SchemaObjectWriter.cs
- DataGridAddNewRow.cs
- Splitter.cs
- PrePostDescendentsWalker.cs
- GeneralTransformGroup.cs
- InternalsVisibleToAttribute.cs
- UntrustedRecipientException.cs
- XmlBoundElement.cs
- HybridObjectCache.cs
- Geometry.cs
- Int64KeyFrameCollection.cs
- XmlUnspecifiedAttribute.cs
- SqlNode.cs
- XmlMtomWriter.cs
- DocobjHost.cs
- WindowHideOrCloseTracker.cs
- ConcurrencyMode.cs
- ColumnBinding.cs
- CharEntityEncoderFallback.cs
- XmlProcessingInstruction.cs
- log.cs
- InvalidFilterCriteriaException.cs
- SessionStateContainer.cs
- UDPClient.cs
- FixedTextPointer.cs
- WinInetCache.cs
- SerialPort.cs
- ColorKeyFrameCollection.cs
- ExceptionHelpers.cs
- MaterialCollection.cs
- _UncName.cs
- LocatorBase.cs
- StickyNote.cs
- DefaultTextStore.cs
- EmptyReadOnlyDictionaryInternal.cs
- LocationSectionRecord.cs
- ContextMenuAutomationPeer.cs
- ColorKeyFrameCollection.cs
- BasePattern.cs
- TextElementEditingBehaviorAttribute.cs
- DataSet.cs
- xmlglyphRunInfo.cs
- CompilationUnit.cs
- TypeGeneratedEventArgs.cs
- SizeLimitedCache.cs
- ModelTreeEnumerator.cs
- Journaling.cs
- ObfuscateAssemblyAttribute.cs
- ObjectReferenceStack.cs
- UserUseLicenseDictionaryLoader.cs
- IfJoinedCondition.cs
- BitmapMetadata.cs
- ModuleBuilderData.cs
- TypeConverterHelper.cs
- _FtpControlStream.cs
- ListBox.cs
- TextInfo.cs
- XmlCompatibilityReader.cs
- SoapTypeAttribute.cs
- SAPICategories.cs
- DependencyPropertyAttribute.cs
- ObjectIDGenerator.cs
- QuaternionAnimationUsingKeyFrames.cs
- ImpersonationContext.cs
- HMACSHA1.cs
- RegistryConfigurationProvider.cs
- XmlReflectionMember.cs
- HttpRuntimeSection.cs
- RegexStringValidator.cs
- SoapClientMessage.cs
- CodeVariableReferenceExpression.cs
- InternalCache.cs
- Menu.cs
- ToolStripSplitButton.cs
- X509ScopedServiceCertificateElement.cs
- MinMaxParagraphWidth.cs
- SecurityKeyIdentifierClause.cs