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
- GeometryCombineModeValidation.cs
- InvokeBinder.cs
- HttpStaticObjectsCollectionBase.cs
- ProtocolViolationException.cs
- EffectiveValueEntry.cs
- SendingRequestEventArgs.cs
- GreenMethods.cs
- BevelBitmapEffect.cs
- Menu.cs
- ProcessThreadCollection.cs
- UrlAuthorizationModule.cs
- TransactionChannelFactory.cs
- ModelTreeEnumerator.cs
- CommandConverter.cs
- TimersDescriptionAttribute.cs
- UpdateTracker.cs
- MimeParameterWriter.cs
- AncestorChangedEventArgs.cs
- DispatcherObject.cs
- TimeSpanValidator.cs
- Selection.cs
- PropertyGridView.cs
- InstanceLockQueryResult.cs
- SystemIcmpV4Statistics.cs
- WindowsListView.cs
- FocusWithinProperty.cs
- OleAutBinder.cs
- Material.cs
- ProgressPage.cs
- ToolStripCollectionEditor.cs
- ProtocolsConfiguration.cs
- NavigationCommands.cs
- GPRECT.cs
- StrokeNodeEnumerator.cs
- XmlDeclaration.cs
- DataServiceClientException.cs
- RequestCachePolicy.cs
- Clipboard.cs
- SafeBitVector32.cs
- categoryentry.cs
- StandardBindingReliableSessionElement.cs
- InvokeProviderWrapper.cs
- EventLogReader.cs
- LocalizationParserHooks.cs
- BlobPersonalizationState.cs
- WebPartRestoreVerb.cs
- TextServicesCompartment.cs
- ScriptResourceAttribute.cs
- BooleanToVisibilityConverter.cs
- InheritanceUI.cs
- TextAction.cs
- OleDbDataReader.cs
- VsPropertyGrid.cs
- TextServicesManager.cs
- DataSourceSelectArguments.cs
- NavigationProgressEventArgs.cs
- ImmutableCollection.cs
- CompiledScopeCriteria.cs
- BitmapEffect.cs
- MailDefinition.cs
- Base64Encoder.cs
- TextLineResult.cs
- Page.cs
- MimeTypeMapper.cs
- XmlAggregates.cs
- ZipIOExtraFieldPaddingElement.cs
- ColorTranslator.cs
- SystemGatewayIPAddressInformation.cs
- BindableAttribute.cs
- FullTrustAssembliesSection.cs
- XamlInt32CollectionSerializer.cs
- ConfigurationFileMap.cs
- StorageComplexTypeMapping.cs
- ListViewItemSelectionChangedEvent.cs
- ConstructorBuilder.cs
- PopOutPanel.cs
- Executor.cs
- FileEnumerator.cs
- storepermissionattribute.cs
- ItemCheckEvent.cs
- IntSecurity.cs
- BuildProvider.cs
- PathFigureCollection.cs
- HandleTable.cs
- FixUp.cs
- VirtualizedContainerService.cs
- BaseValidator.cs
- Renderer.cs
- DisableDpiAwarenessAttribute.cs
- ImageDrawing.cs
- StreamingContext.cs
- ReadOnlyHierarchicalDataSourceView.cs
- InternalCache.cs
- ForAllOperator.cs
- DesignerActionTextItem.cs
- JsonWriter.cs
- TimelineClockCollection.cs
- SqlDataRecord.cs
- EmptyEnumerator.cs
- BitmapVisualManager.cs