Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- MSG.cs
- CommonDialog.cs
- Shape.cs
- CodeEventReferenceExpression.cs
- ChangesetResponse.cs
- HwndStylusInputProvider.cs
- SqlUserDefinedTypeAttribute.cs
- ArcSegment.cs
- Expressions.cs
- Control.cs
- designeractionlistschangedeventargs.cs
- NetworkAddressChange.cs
- DefaultPropertiesToSend.cs
- SHA384.cs
- ListenerAdaptersInstallComponent.cs
- ListCollectionView.cs
- HttpFileCollection.cs
- UInt16.cs
- HtmlUtf8RawTextWriter.cs
- GeometryHitTestParameters.cs
- AutoSizeToolBoxItem.cs
- Shape.cs
- IssuanceTokenProviderBase.cs
- ExpressionCopier.cs
- WebResourceAttribute.cs
- MemberExpression.cs
- JsonReaderWriterFactory.cs
- DesignBindingEditor.cs
- WizardSideBarListControlItemEventArgs.cs
- PathSegmentCollection.cs
- CompositeFontParser.cs
- Model3DGroup.cs
- WindowsFormsSynchronizationContext.cs
- ApplicationTrust.cs
- SqlExpressionNullability.cs
- InkCanvasFeedbackAdorner.cs
- DataRow.cs
- InvalidOperationException.cs
- TransactionScope.cs
- PersonalizationAdministration.cs
- Literal.cs
- NumberSubstitution.cs
- MetadataItem.cs
- FamilyMap.cs
- HandlerMappingMemo.cs
- XmlAttributes.cs
- ReturnType.cs
- LinkedResource.cs
- CredentialSelector.cs
- IndexedString.cs
- GeneralTransform3DTo2D.cs
- Resources.Designer.cs
- ExtentKey.cs
- HMACMD5.cs
- CustomErrorsSection.cs
- ViewEvent.cs
- EntityClassGenerator.cs
- EntitySqlQueryCacheEntry.cs
- StringFreezingAttribute.cs
- TempFiles.cs
- TextComposition.cs
- PrivilegeNotHeldException.cs
- TransactionFlowBindingElement.cs
- SqlVersion.cs
- TextLine.cs
- GenericWebPart.cs
- QilList.cs
- SettingsPropertyValueCollection.cs
- ButtonPopupAdapter.cs
- SoapExtensionStream.cs
- WmlImageAdapter.cs
- Char.cs
- ModelVisual3D.cs
- XmlSchemaSequence.cs
- ServiceModelConfigurationSectionGroup.cs
- SystemBrushes.cs
- ObjectKeyFrameCollection.cs
- BamlWriter.cs
- DataGridViewCellMouseEventArgs.cs
- InstanceView.cs
- HttpCapabilitiesBase.cs
- Mapping.cs
- ExpressionEditorSheet.cs
- ItemType.cs
- WebPartCatalogAddVerb.cs
- FloaterParaClient.cs
- ActionItem.cs
- MdiWindowListStrip.cs
- OdbcCommand.cs
- MergeFilterQuery.cs
- CodeExpressionCollection.cs
- Privilege.cs
- TypeToken.cs
- FillErrorEventArgs.cs
- KnownAssembliesSet.cs
- StylusEventArgs.cs
- DataBinder.cs
- WizardStepBase.cs
- ObfuscationAttribute.cs
- SystemColorTracker.cs