Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DataPagerField.cs
- ListMarkerSourceInfo.cs
- PenContexts.cs
- FilterableData.cs
- BCLDebug.cs
- IndentTextWriter.cs
- FusionWrap.cs
- CurrentChangingEventArgs.cs
- Rect3D.cs
- EncryptedType.cs
- ResolveMatchesMessageCD1.cs
- BitStack.cs
- EventProviderClassic.cs
- NoPersistScope.cs
- SQLInt32Storage.cs
- ImageClickEventArgs.cs
- ConfigUtil.cs
- ScrollViewerAutomationPeer.cs
- TraceFilter.cs
- SimpleWorkerRequest.cs
- counter.cs
- XmlAutoDetectWriter.cs
- AuditLevel.cs
- CollectionBase.cs
- FixedSOMLineCollection.cs
- ColumnHeaderConverter.cs
- DropTarget.cs
- ContractBase.cs
- ConfigXmlText.cs
- OverflowException.cs
- AuthenticationService.cs
- CompressStream.cs
- SqlNotificationEventArgs.cs
- IsolatedStorageFileStream.cs
- DependencySource.cs
- XhtmlBasicCommandAdapter.cs
- XmlCharCheckingWriter.cs
- MessageQueuePermissionEntry.cs
- BufferBuilder.cs
- VerificationAttribute.cs
- ArrangedElement.cs
- ListDictionary.cs
- PtsHost.cs
- FilterUserControlBase.cs
- MimeTextImporter.cs
- CodeParameterDeclarationExpression.cs
- EntityViewContainer.cs
- UnitySerializationHolder.cs
- EditorPartChrome.cs
- WsdlInspector.cs
- Attributes.cs
- XmlSerializerVersionAttribute.cs
- XPathAxisIterator.cs
- AtomParser.cs
- PngBitmapEncoder.cs
- RepeatBehaviorConverter.cs
- Color.cs
- ExpressionBuilder.cs
- UriScheme.cs
- StorageScalarPropertyMapping.cs
- XmlHierarchicalEnumerable.cs
- TreeViewEvent.cs
- BamlLocalizableResourceKey.cs
- CheckBoxList.cs
- ScrollEvent.cs
- HostProtectionPermission.cs
- ScrollEvent.cs
- WebPartConnectionsConnectVerb.cs
- PagerSettings.cs
- MaskedTextBoxDesigner.cs
- SupportedAddressingMode.cs
- TransactionFlowOption.cs
- Win32.cs
- sqlinternaltransaction.cs
- StringDictionary.cs
- StartUpEventArgs.cs
- PackageFilter.cs
- NonParentingControl.cs
- Line.cs
- NotifyCollectionChangedEventArgs.cs
- HTTPNotFoundHandler.cs
- PathFigureCollection.cs
- UnsafeNativeMethodsCLR.cs
- DataSourceHelper.cs
- InputDevice.cs
- BitmapSource.cs
- WorkflowClientDeliverMessageWrapper.cs
- DataGridToolTip.cs
- ActiveDocumentEvent.cs
- MSAANativeProvider.cs
- RegexCapture.cs
- Matrix.cs
- PathParser.cs
- PersonalizationStateQuery.cs
- ObjectDataSourceDisposingEventArgs.cs
- SimplePropertyEntry.cs
- IRCollection.cs
- NetTcpSectionData.cs
- GridViewCommandEventArgs.cs
- XmlSchemaObjectTable.cs