Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SoapBinding.cs
- Package.cs
- AnimationTimeline.cs
- TableLayoutPanelBehavior.cs
- WebPartEditorApplyVerb.cs
- SqlCacheDependencyDatabase.cs
- DataGridCommandEventArgs.cs
- BuilderPropertyEntry.cs
- ConnectionStringEditor.cs
- SuppressMergeCheckAttribute.cs
- BamlVersionHeader.cs
- VScrollProperties.cs
- DBNull.cs
- SystemFonts.cs
- IntSecurity.cs
- BlockCollection.cs
- WebCategoryAttribute.cs
- GridViewRowPresenterBase.cs
- DispatcherEventArgs.cs
- RowUpdatingEventArgs.cs
- SqlStatistics.cs
- ChildTable.cs
- EventLogPermissionAttribute.cs
- WeakReferenceEnumerator.cs
- Parsers.cs
- HtmlTitle.cs
- ThaiBuddhistCalendar.cs
- TypefaceMap.cs
- DbParameterCollectionHelper.cs
- XmlName.cs
- XmlSchemaComplexContentRestriction.cs
- OdbcParameterCollection.cs
- listitem.cs
- ToolStripDropDownClosingEventArgs.cs
- WebUtil.cs
- DataGridItemEventArgs.cs
- BlobPersonalizationState.cs
- ComboBox.cs
- brushes.cs
- PointCollectionValueSerializer.cs
- Geometry.cs
- ResolveCriteria.cs
- DbProviderFactories.cs
- IsolationInterop.cs
- PageThemeBuildProvider.cs
- DiagnosticsConfigurationHandler.cs
- XDRSchema.cs
- SoapExtension.cs
- BaseServiceProvider.cs
- BitmapFrameDecode.cs
- CollectionDataContractAttribute.cs
- TextMetrics.cs
- WhiteSpaceTrimStringConverter.cs
- OperandQuery.cs
- MetadataArtifactLoaderCompositeResource.cs
- MimeFormatExtensions.cs
- Contracts.cs
- BaseAsyncResult.cs
- AsyncResult.cs
- DataGridViewBindingCompleteEventArgs.cs
- CheckBoxBaseAdapter.cs
- SimpleTextLine.cs
- SafeRegistryKey.cs
- Util.cs
- FilteredDataSetHelper.cs
- ScriptingJsonSerializationSection.cs
- DependencyPropertyChangedEventArgs.cs
- QueryPageSettingsEventArgs.cs
- UpDownEvent.cs
- SafeWaitHandle.cs
- PageStatePersister.cs
- Comparer.cs
- WsrmMessageInfo.cs
- ReadonlyMessageFilter.cs
- ExternalDataExchangeService.cs
- AccessDataSourceView.cs
- IPAddressCollection.cs
- SettingsContext.cs
- XmlWrappingWriter.cs
- CryptoConfig.cs
- IRCollection.cs
- PropertyStore.cs
- MappedMetaModel.cs
- HttpWrapper.cs
- DataGridColumn.cs
- ExpressionBuilder.cs
- RepeaterCommandEventArgs.cs
- OleStrCAMarshaler.cs
- Paragraph.cs
- WebPartDisplayMode.cs
- SessionPageStateSection.cs
- InvalidEnumArgumentException.cs
- AbandonedMutexException.cs
- SequenceDesignerAccessibleObject.cs
- TextServicesContext.cs
- AddInToken.cs
- ObservableDictionary.cs
- _NestedSingleAsyncResult.cs
- HebrewCalendar.cs
- ToolBarButton.cs