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
- Part.cs
- ConfigurationLockCollection.cs
- _Connection.cs
- Grant.cs
- AssertFilter.cs
- CubicEase.cs
- LocationReferenceEnvironment.cs
- EDesignUtil.cs
- TargetException.cs
- Html32TextWriter.cs
- StrokeCollection2.cs
- ConsoleTraceListener.cs
- SemanticResultValue.cs
- CommandDevice.cs
- DataKey.cs
- PixelFormats.cs
- FusionWrap.cs
- XmlSubtreeReader.cs
- XmlAttributeAttribute.cs
- Form.cs
- ChooseAction.cs
- EqualityArray.cs
- ACE.cs
- DefaultTextStore.cs
- ErrorActivity.cs
- ProjectionCamera.cs
- TdsValueSetter.cs
- EntityContainerEmitter.cs
- DataControlImageButton.cs
- GC.cs
- HighlightVisual.cs
- SimpleBitVector32.cs
- BrowserCapabilitiesCodeGenerator.cs
- ProfileEventArgs.cs
- StreamingContext.cs
- SessionSwitchEventArgs.cs
- InteropExecutor.cs
- XmlSchemaSubstitutionGroup.cs
- Line.cs
- SaveCardRequest.cs
- MetadataArtifactLoader.cs
- Expr.cs
- HttpStreamMessageEncoderFactory.cs
- SystemIPInterfaceProperties.cs
- SafeNativeMethodsOther.cs
- _NTAuthentication.cs
- TypeDependencyAttribute.cs
- FormCollection.cs
- AnnotationMap.cs
- StringToken.cs
- UnmanagedMemoryAccessor.cs
- Byte.cs
- DataGridViewDesigner.cs
- ThousandthOfEmRealPoints.cs
- CaseInsensitiveOrdinalStringComparer.cs
- Win32MouseDevice.cs
- ConnectionPoolRegistry.cs
- TcpClientSocketManager.cs
- HttpHandlersSection.cs
- TextServicesLoader.cs
- SmiSettersStream.cs
- GAC.cs
- FixedTextPointer.cs
- PageResolution.cs
- ClientConfigurationHost.cs
- contentDescriptor.cs
- HandleCollector.cs
- PermissionSet.cs
- BinHexEncoder.cs
- SqlBuilder.cs
- HtmlShimManager.cs
- ScriptingJsonSerializationSection.cs
- TextServicesProperty.cs
- PictureBox.cs
- MsmqDecodeHelper.cs
- MaterialGroup.cs
- PeerMaintainer.cs
- ToolboxItemCollection.cs
- SQLSingle.cs
- RemotingConfigParser.cs
- BackStopAuthenticationModule.cs
- Viewport3DAutomationPeer.cs
- RolePrincipal.cs
- ProfileProvider.cs
- ScriptResourceAttribute.cs
- InertiaRotationBehavior.cs
- TryLoadRunnableWorkflowCommand.cs
- WebRequestModuleElement.cs
- DesignOnlyAttribute.cs
- GeneralTransform3DGroup.cs
- CalendarTable.cs
- TrustManagerMoreInformation.cs
- SoapExtension.cs
- ChangeDirector.cs
- TextTreeFixupNode.cs
- SQLStringStorage.cs
- DeploymentSection.cs
- ErrorsHelper.cs
- VisualBasicSettingsHandler.cs
- Point3DAnimationBase.cs