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
- GraphicsContainer.cs
- MSAANativeProvider.cs
- BinaryFormatter.cs
- DataSourceCacheDurationConverter.cs
- ApplicationHost.cs
- SoundPlayer.cs
- DataPagerFieldCommandEventArgs.cs
- PreProcessor.cs
- SimpleMailWebEventProvider.cs
- EntityReference.cs
- XPathDocumentIterator.cs
- SocketCache.cs
- ChtmlTextBoxAdapter.cs
- CalendarDay.cs
- CacheDict.cs
- UnSafeCharBuffer.cs
- SQLConvert.cs
- WebPartTransformer.cs
- CommonDialog.cs
- PersonalizablePropertyEntry.cs
- FactoryId.cs
- TreeViewImageKeyConverter.cs
- CustomAttribute.cs
- ErrorTolerantObjectWriter.cs
- Console.cs
- WebEventTraceProvider.cs
- PersonalizableTypeEntry.cs
- InvalidDataException.cs
- ResourceDefaultValueAttribute.cs
- Timer.cs
- Cursor.cs
- Privilege.cs
- AuthenticatedStream.cs
- TextEvent.cs
- QualificationDataItem.cs
- WebPartConnectionsEventArgs.cs
- ProcessModule.cs
- TraceSection.cs
- BoolExpression.cs
- MappingSource.cs
- Context.cs
- GroupByQueryOperator.cs
- FontDifferentiator.cs
- RtType.cs
- Utility.cs
- UnsafeNativeMethods.cs
- AffineTransform3D.cs
- DynamicQueryableWrapper.cs
- CalendarItem.cs
- CustomTypeDescriptor.cs
- _FtpControlStream.cs
- OracleSqlParser.cs
- PropertyRef.cs
- _SafeNetHandles.cs
- OuterGlowBitmapEffect.cs
- Tile.cs
- WhitespaceSignificantCollectionAttribute.cs
- MasterPageBuildProvider.cs
- ValueChangedEventManager.cs
- WebPartConnectVerb.cs
- DisplayNameAttribute.cs
- DynamicResourceExtensionConverter.cs
- ExpressionNode.cs
- EditorZone.cs
- TableRowCollection.cs
- SafeProcessHandle.cs
- SqlUnionizer.cs
- SerialStream.cs
- SymbolEqualComparer.cs
- StatusBar.cs
- KeyTime.cs
- XmlSchemaElement.cs
- IpcPort.cs
- SubstitutionResponseElement.cs
- RuntimeVariableList.cs
- TableRowCollection.cs
- ObjectQueryExecutionPlan.cs
- TreeViewItem.cs
- Triplet.cs
- EmptyStringExpandableObjectConverter.cs
- ButtonFieldBase.cs
- SiteMembershipCondition.cs
- ColorAnimationUsingKeyFrames.cs
- remotingproxy.cs
- UrlAuthFailureHandler.cs
- OdbcConnectionStringbuilder.cs
- SqlWriter.cs
- DataSourceSelectArguments.cs
- TemplateDefinition.cs
- _AuthenticationState.cs
- CollectionBuilder.cs
- NativeMethods.cs
- CodeDelegateInvokeExpression.cs
- Double.cs
- DiagnosticTrace.cs
- DetailsViewPagerRow.cs
- HtmlElement.cs
- TypeUtil.cs
- HostedTcpTransportManager.cs
- SqlGenericUtil.cs