Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathDescendantIterator.cs / 1305376 / XPathDescendantIterator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace MS.Internal.Xml.XPath { using System.Xml.XPath; internal class XPathDescendantIterator: XPathAxisIterator { private int level = 0; public XPathDescendantIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : base(nav, type, matchSelf) {} public XPathDescendantIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : base(nav, name, namespaceURI, matchSelf) {} public XPathDescendantIterator(XPathDescendantIterator it) : base(it) { this.level = it.level; } public override XPathNodeIterator Clone() { return new XPathDescendantIterator(this); } public override bool MoveNext() { if (first) { first = false; if (matchSelf && Matches) { position = 1; return true; } } while (true) { if (nav.MoveToFirstChild()) { level++; } else { while (true) { if (level == 0) { return false; } if (nav.MoveToNext()) { break; } nav.MoveToParent(); level--; } } if (Matches) { position++; return true; } } } } } // 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.Xml.XPath; internal class XPathDescendantIterator: XPathAxisIterator { private int level = 0; public XPathDescendantIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : base(nav, type, matchSelf) {} public XPathDescendantIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : base(nav, name, namespaceURI, matchSelf) {} public XPathDescendantIterator(XPathDescendantIterator it) : base(it) { this.level = it.level; } public override XPathNodeIterator Clone() { return new XPathDescendantIterator(this); } public override bool MoveNext() { if (first) { first = false; if (matchSelf && Matches) { position = 1; return true; } } while (true) { if (nav.MoveToFirstChild()) { level++; } else { while (true) { if (level == 0) { return false; } if (nav.MoveToNext()) { break; } nav.MoveToParent(); level--; } } if (Matches) { position++; return true; } } } } } // 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
- GetBrowserTokenRequest.cs
- XamlPathDataSerializer.cs
- ImageSource.cs
- MaterialGroup.cs
- CodeTypeDelegate.cs
- AnimationException.cs
- AutoResetEvent.cs
- NavigationHelper.cs
- NamedObject.cs
- PreservationFileReader.cs
- ButtonPopupAdapter.cs
- BitmapEffectState.cs
- StyleSheetComponentEditor.cs
- PointAnimationBase.cs
- BoundPropertyEntry.cs
- VScrollBar.cs
- FontFamilyIdentifier.cs
- HostingEnvironment.cs
- Utils.cs
- EventDescriptor.cs
- GenerateTemporaryAssemblyTask.cs
- StructuredTypeInfo.cs
- FamilyCollection.cs
- DataTableNameHandler.cs
- NativeActivityMetadata.cs
- Attribute.cs
- MatrixValueSerializer.cs
- IndexOutOfRangeException.cs
- GridViewRowEventArgs.cs
- StylusCollection.cs
- JulianCalendar.cs
- LinkedList.cs
- _AutoWebProxyScriptEngine.cs
- CheckBox.cs
- OdbcConnectionPoolProviderInfo.cs
- CollectionViewGroup.cs
- _NTAuthentication.cs
- InheritanceContextHelper.cs
- EntityStoreSchemaFilterEntry.cs
- DataGridViewImageColumn.cs
- PathFigureCollectionValueSerializer.cs
- SchemaObjectWriter.cs
- DbConnectionInternal.cs
- OdbcConnectionFactory.cs
- newinstructionaction.cs
- QuerySubExprEliminator.cs
- SocketPermission.cs
- DecoderExceptionFallback.cs
- Schema.cs
- Transform.cs
- GridViewRow.cs
- PathSegmentCollection.cs
- DataViewManagerListItemTypeDescriptor.cs
- XmlSchemaNotation.cs
- SQLInt64.cs
- SetStoryboardSpeedRatio.cs
- TransformerInfoCollection.cs
- BackgroundWorker.cs
- WebPartEditorCancelVerb.cs
- GetPageNumberCompletedEventArgs.cs
- ProcessHostServerConfig.cs
- BamlBinaryReader.cs
- UnsafeNativeMethodsMilCoreApi.cs
- cookiecollection.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- TreeViewImageIndexConverter.cs
- SerializationBinder.cs
- PassportAuthentication.cs
- DynamicFilterExpression.cs
- While.cs
- DayRenderEvent.cs
- SystemPens.cs
- ResourceAttributes.cs
- ControlBuilderAttribute.cs
- RijndaelManaged.cs
- CompModSwitches.cs
- SystemTcpConnection.cs
- SQLInt16Storage.cs
- SafeCloseHandleCritical.cs
- EraserBehavior.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- EntitySqlQueryBuilder.cs
- ActivityExecutionContext.cs
- RelationshipSet.cs
- GetPageCompletedEventArgs.cs
- DurableInstanceProvider.cs
- FixedElement.cs
- DomainUpDown.cs
- PointAnimationUsingKeyFrames.cs
- DataSetMappper.cs
- FileSystemEventArgs.cs
- TypeResolvingOptions.cs
- ToolStripSettings.cs
- InertiaExpansionBehavior.cs
- BufferBuilder.cs
- LazyLoadBehavior.cs
- StylusPointDescription.cs
- X509Certificate2.cs
- PropertyDescriptorComparer.cs
- LogReserveAndAppendState.cs