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
- Tuple.cs
- MessagePropertyDescription.cs
- TextDecorationCollectionConverter.cs
- XmlSchemaGroupRef.cs
- SiteMapNodeItem.cs
- SystemIPInterfaceProperties.cs
- Divide.cs
- sqlpipe.cs
- nulltextcontainer.cs
- DrawingImage.cs
- WizardPanel.cs
- RoleManagerModule.cs
- Validator.cs
- ProxyHwnd.cs
- Subtree.cs
- MsmqOutputChannel.cs
- GridLengthConverter.cs
- InputEventArgs.cs
- XmlKeywords.cs
- UpdateManifestForBrowserApplication.cs
- UrlPath.cs
- ObjectMemberMapping.cs
- WebPartConnection.cs
- CompositeFontFamily.cs
- Int32Storage.cs
- TextChangedEventArgs.cs
- UxThemeWrapper.cs
- HashSetEqualityComparer.cs
- ConfigurationFileMap.cs
- FileEnumerator.cs
- EnumerableRowCollectionExtensions.cs
- PageCatalogPart.cs
- DurableInstanceContextProvider.cs
- ShaderEffect.cs
- HealthMonitoringSection.cs
- SafeFileMappingHandle.cs
- PersistenceParticipant.cs
- MetadataConversionError.cs
- EntityContainerEmitter.cs
- UpdatePanelControlTrigger.cs
- ExtenderControl.cs
- ParsedRoute.cs
- ApplicationHost.cs
- DataGridViewRowCollection.cs
- ListViewGroupItemCollection.cs
- WorkflowMessageEventHandler.cs
- TemplatePropertyEntry.cs
- TrustSection.cs
- FacetChecker.cs
- ReliableOutputConnection.cs
- PropertyChangedEventManager.cs
- ContractUtils.cs
- GPPOINT.cs
- AutomationPropertyInfo.cs
- AnchorEditor.cs
- DataGridBoolColumn.cs
- EdgeProfileValidation.cs
- DefaultValueMapping.cs
- GeneratedCodeAttribute.cs
- ILGen.cs
- DelimitedListTraceListener.cs
- PrintController.cs
- InvalidCommandTreeException.cs
- TextEditorContextMenu.cs
- ConnectionPoolManager.cs
- ConfigXmlAttribute.cs
- SplitterCancelEvent.cs
- InvalidCastException.cs
- XsltQilFactory.cs
- ChannelManagerService.cs
- XmlSchemaGroupRef.cs
- PointAnimationClockResource.cs
- ContractBase.cs
- AddInPipelineAttributes.cs
- BrowserDefinition.cs
- TextTreeText.cs
- DmlSqlGenerator.cs
- EnumValidator.cs
- DesignTimeXamlWriter.cs
- PathSegment.cs
- HtmlEmptyTagControlBuilder.cs
- TextChange.cs
- EpmHelper.cs
- SerializationFieldInfo.cs
- HwndTarget.cs
- CodeCatchClause.cs
- StateChangeEvent.cs
- SecurityKeyUsage.cs
- Empty.cs
- XhtmlConformanceSection.cs
- IssuedTokenClientElement.cs
- SudsParser.cs
- DataControlLinkButton.cs
- DoubleLinkList.cs
- ReferenceAssemblyAttribute.cs
- BufferedGraphicsContext.cs
- FactoryGenerator.cs
- CapiSymmetricAlgorithm.cs
- ShutDownListener.cs
- UITypeEditors.cs