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
- MarginsConverter.cs
- CodeSnippetTypeMember.cs
- PolicyValidationException.cs
- RangeValueProviderWrapper.cs
- PkcsUtils.cs
- PropertyGeneratedEventArgs.cs
- EventBuilder.cs
- PackageRelationshipSelector.cs
- InstanceOwnerException.cs
- glyphs.cs
- IRCollection.cs
- NameSpaceEvent.cs
- PropertyRecord.cs
- PersonalizationProvider.cs
- TemplateApplicationHelper.cs
- ResourceIDHelper.cs
- ListDictionaryInternal.cs
- GridViewCommandEventArgs.cs
- dtdvalidator.cs
- ExitEventArgs.cs
- MemoryFailPoint.cs
- ReferenceEqualityComparer.cs
- TemplateInstanceAttribute.cs
- IsolatedStorageFilePermission.cs
- BmpBitmapEncoder.cs
- DatatypeImplementation.cs
- FlowDocumentReader.cs
- MediaScriptCommandRoutedEventArgs.cs
- PropertyOverridesTypeEditor.cs
- KeyGestureValueSerializer.cs
- DescendentsWalkerBase.cs
- PartBasedPackageProperties.cs
- precedingsibling.cs
- SmtpFailedRecipientsException.cs
- SafeFileMapViewHandle.cs
- ColorMatrix.cs
- linebase.cs
- MenuCommand.cs
- HandleTable.cs
- GlyphCache.cs
- FixedSOMTable.cs
- LocalizationComments.cs
- XmlImplementation.cs
- ADMembershipUser.cs
- PixelShader.cs
- DesignerTransactionCloseEvent.cs
- Pair.cs
- BezierSegment.cs
- RNGCryptoServiceProvider.cs
- ProxyHelper.cs
- Window.cs
- DataSetMappper.cs
- GridErrorDlg.cs
- FormViewCommandEventArgs.cs
- GradientStopCollection.cs
- Connector.cs
- MarshalByValueComponent.cs
- InputLanguageProfileNotifySink.cs
- XamlSerializationHelper.cs
- ParameterRetriever.cs
- ReflectionServiceProvider.cs
- ConfigurationSectionGroupCollection.cs
- SerializableTypeCodeDomSerializer.cs
- ApplyTemplatesAction.cs
- CodeExporter.cs
- BaseDataListComponentEditor.cs
- JoinCqlBlock.cs
- CodeStatementCollection.cs
- CryptoKeySecurity.cs
- EditingCommands.cs
- TransformerInfoCollection.cs
- WebRequestModuleElement.cs
- DataPager.cs
- ValueOfAction.cs
- ClaimComparer.cs
- InputChannelBinder.cs
- WSSecurityOneDotZeroSendSecurityHeader.cs
- ProviderException.cs
- Substitution.cs
- ToolStrip.cs
- TextRenderer.cs
- ToggleProviderWrapper.cs
- ResourceSetExpression.cs
- CodeCommentStatementCollection.cs
- XmlWriterTraceListener.cs
- SoapAttributeOverrides.cs
- TagMapCollection.cs
- BufferedWebEventProvider.cs
- XPathNavigatorReader.cs
- InputElement.cs
- DetailsViewInsertEventArgs.cs
- VSWCFServiceContractGenerator.cs
- GeneralTransformGroup.cs
- ServiceDiscoveryElement.cs
- MessagePartDescriptionCollection.cs
- SoapEnvelopeProcessingElement.cs
- ToolStripOverflow.cs
- DataControlButton.cs
- TcpDuplicateContext.cs
- StringFormat.cs