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
- DesignerPerfEventProvider.cs
- PreviewKeyDownEventArgs.cs
- BindingMAnagerBase.cs
- BitmapDecoder.cs
- XmlSchemaRedefine.cs
- SecurityListenerSettingsLifetimeManager.cs
- XmlSchemaSimpleTypeList.cs
- ByteStreamGeometryContext.cs
- UIInitializationException.cs
- DragDropHelper.cs
- TraceLevelStore.cs
- securitycriticaldata.cs
- TextElementAutomationPeer.cs
- COMException.cs
- DbConnectionInternal.cs
- DataProtection.cs
- AsyncOperation.cs
- SqlClientPermission.cs
- SHA384CryptoServiceProvider.cs
- InvokeHandlers.cs
- MsdtcClusterUtils.cs
- GenericXmlSecurityToken.cs
- HttpWebResponse.cs
- XPathQilFactory.cs
- SqlTransaction.cs
- WaitHandleCannotBeOpenedException.cs
- DocumentPageView.cs
- OracleParameterBinding.cs
- LoadedEvent.cs
- HttpRequestMessageProperty.cs
- PlainXmlSerializer.cs
- VoiceInfo.cs
- X509Utils.cs
- TraceLog.cs
- FastEncoderStatics.cs
- MetadataPropertyCollection.cs
- QilPatternVisitor.cs
- PrimitiveType.cs
- AttachedAnnotation.cs
- EllipticalNodeOperations.cs
- TabRenderer.cs
- Pkcs9Attribute.cs
- RouteItem.cs
- LicenseProviderAttribute.cs
- Screen.cs
- SpotLight.cs
- EntityDataSourceState.cs
- JsonDeserializer.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- FilteredDataSetHelper.cs
- ConnectionStringEditor.cs
- SmtpTransport.cs
- MbpInfo.cs
- ConfigXmlWhitespace.cs
- FormViewUpdatedEventArgs.cs
- SqlCacheDependencySection.cs
- MetadataItemEmitter.cs
- SendKeys.cs
- ImageCodecInfo.cs
- ComboBoxAutomationPeer.cs
- DesignerCapabilities.cs
- CryptoApi.cs
- figurelengthconverter.cs
- WindowsSidIdentity.cs
- PermissionSetTriple.cs
- MailHeaderInfo.cs
- ScriptReference.cs
- TextTreeTextNode.cs
- RuntimeArgumentHandle.cs
- NavigationCommands.cs
- QuotedPrintableStream.cs
- QueryOutputWriter.cs
- FamilyMap.cs
- SqlGenerator.cs
- BindingMemberInfo.cs
- ColumnCollectionEditor.cs
- securitycriticaldata.cs
- MethodBuilder.cs
- RenamedEventArgs.cs
- EventListener.cs
- HtmlElementEventArgs.cs
- ColumnMap.cs
- SQlBooleanStorage.cs
- CancelEventArgs.cs
- PaintEvent.cs
- DrawingAttributes.cs
- SQLBinary.cs
- DayRenderEvent.cs
- PropertyPathWorker.cs
- FlowDocumentReader.cs
- ImageButton.cs
- LiteralControl.cs
- RuntimeConfig.cs
- SeparatorAutomationPeer.cs
- UnmanagedMarshal.cs
- GeometryHitTestResult.cs
- CfgParser.cs
- TopClause.cs
- ContentFilePart.cs
- ServiceBuildProvider.cs