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
- ServiceNameCollection.cs
- UpdateExpressionVisitor.cs
- WorkflowInspectionServices.cs
- TextEndOfLine.cs
- MSAAWinEventWrap.cs
- ComboBoxItem.cs
- UidManager.cs
- DataTable.cs
- UICuesEvent.cs
- AccessDataSource.cs
- WindowAutomationPeer.cs
- HtmlWindowCollection.cs
- RequestSecurityToken.cs
- ObjectDataSourceWizardForm.cs
- _WinHttpWebProxyDataBuilder.cs
- SAPICategories.cs
- Region.cs
- Peer.cs
- SafeFileHandle.cs
- InvalidAsynchronousStateException.cs
- WindowVisualStateTracker.cs
- BooleanExpr.cs
- TextDocumentView.cs
- _SslState.cs
- TextUtf8RawTextWriter.cs
- EventLogStatus.cs
- LineVisual.cs
- AdRotatorDesigner.cs
- PartialTrustVisibleAssembliesSection.cs
- MobileCapabilities.cs
- DataGridTable.cs
- SqlDataSourceCustomCommandEditor.cs
- EntityContainerEmitter.cs
- LinearGradientBrush.cs
- WebBrowserBase.cs
- ProviderCollection.cs
- OdbcError.cs
- DescendentsWalker.cs
- MatrixTransform.cs
- ListenerElementsCollection.cs
- ExtentJoinTreeNode.cs
- RoleServiceManager.cs
- MobileListItem.cs
- SystemBrushes.cs
- Util.cs
- CanonicalXml.cs
- OrderedDictionaryStateHelper.cs
- CacheRequest.cs
- RelationshipNavigation.cs
- UriSection.cs
- ListViewItem.cs
- InstalledVoice.cs
- HtmlInputText.cs
- NavigationFailedEventArgs.cs
- RenameRuleObjectDialog.cs
- ParameterModifier.cs
- ServicePointManager.cs
- DirtyTextRange.cs
- QueryCacheKey.cs
- ButtonPopupAdapter.cs
- BigInt.cs
- ObjectDataSourceChooseTypePanel.cs
- SafeArrayRankMismatchException.cs
- Boolean.cs
- PerSessionInstanceContextProvider.cs
- ToolStripRenderEventArgs.cs
- HtmlControl.cs
- SqlInternalConnectionTds.cs
- HttpCookie.cs
- MimePart.cs
- KeyEventArgs.cs
- MinMaxParagraphWidth.cs
- ServiceOperationParameter.cs
- InputMethodStateTypeInfo.cs
- QueryReaderSettings.cs
- LocatorPart.cs
- PrtCap_Public_Simple.cs
- SqlMethodAttribute.cs
- TextPatternIdentifiers.cs
- DrawingContextDrawingContextWalker.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- ErrorRuntimeConfig.cs
- SplineKeyFrames.cs
- InputLanguageCollection.cs
- XmlTextEncoder.cs
- UrlUtility.cs
- DBProviderConfigurationHandler.cs
- SqlReferenceCollection.cs
- PersonalizationStateInfo.cs
- MatrixTransform3D.cs
- ImageMapEventArgs.cs
- XmlDataCollection.cs
- MsmqIntegrationProcessProtocolHandler.cs
- PolyLineSegment.cs
- HtmlTableRowCollection.cs
- TypeCollectionDesigner.xaml.cs
- ModuleConfigurationInfo.cs
- OdbcConnectionFactory.cs
- GridLengthConverter.cs
- MgmtConfigurationRecord.cs