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
- SignedXmlDebugLog.cs
- ListSourceHelper.cs
- InfoCardTrace.cs
- CheckBoxField.cs
- DesignerDataSourceView.cs
- XmlHelper.cs
- BaseResourcesBuildProvider.cs
- ConfigurationSettings.cs
- PagedDataSource.cs
- NotifyInputEventArgs.cs
- LicenseContext.cs
- XmlDesignerDataSourceView.cs
- CopyNodeSetAction.cs
- PropertyGeneratedEventArgs.cs
- NativeObjectSecurity.cs
- AspNetSynchronizationContext.cs
- DetailsViewDeleteEventArgs.cs
- EpmHelper.cs
- DrawingContextWalker.cs
- DataServiceContext.cs
- TextCharacters.cs
- ViewGenResults.cs
- FormatException.cs
- CustomAttributeFormatException.cs
- EntryWrittenEventArgs.cs
- MarkerProperties.cs
- DbBuffer.cs
- ProtocolsConfigurationHandler.cs
- StaticResourceExtension.cs
- DrawingContextDrawingContextWalker.cs
- BinaryWriter.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- SHA384Managed.cs
- StylusPointProperties.cs
- Calendar.cs
- CorePropertiesFilter.cs
- XPathDocumentIterator.cs
- DNS.cs
- CompileLiteralTextParser.cs
- ModuleBuilderData.cs
- Point3DIndependentAnimationStorage.cs
- FlowDocumentReader.cs
- DBConnection.cs
- DataGridViewRowConverter.cs
- SimpleType.cs
- FileCodeGroup.cs
- BamlRecordWriter.cs
- DynamicMethod.cs
- XPathAncestorIterator.cs
- EntityCodeGenerator.cs
- SevenBitStream.cs
- XmlSchemaException.cs
- RuleSetBrowserDialog.cs
- TaskExceptionHolder.cs
- PeerPresenceInfo.cs
- DataGridCheckBoxColumn.cs
- DataGridHeaderBorder.cs
- WindowsGraphics.cs
- IdentityHolder.cs
- MissingFieldException.cs
- DataTableMapping.cs
- SortExpressionBuilder.cs
- WindowsFormsSynchronizationContext.cs
- CustomPopupPlacement.cs
- WinFormsSpinner.cs
- InvalidCommandTreeException.cs
- InputMethodStateChangeEventArgs.cs
- SQLCharsStorage.cs
- BadImageFormatException.cs
- sqlpipe.cs
- WindowsHyperlink.cs
- XPathExpr.cs
- TranslateTransform.cs
- DBCommand.cs
- PauseStoryboard.cs
- ComplexPropertyEntry.cs
- CompModSwitches.cs
- FillErrorEventArgs.cs
- XmlDictionaryWriter.cs
- TextRunCache.cs
- HtmlInputImage.cs
- CounterCreationData.cs
- XpsStructure.cs
- NotConverter.cs
- SoapConverter.cs
- ElementInit.cs
- EventBuilder.cs
- ImageCodecInfoPrivate.cs
- HandlerMappingMemo.cs
- Hash.cs
- ResourceContainer.cs
- RegisteredExpandoAttribute.cs
- Config.cs
- EmptyStringExpandableObjectConverter.cs
- FixedSOMTableRow.cs
- IDispatchConstantAttribute.cs
- ClassicBorderDecorator.cs
- XmlWriter.cs
- DuplicateDetector.cs
- Triplet.cs