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
- XamlPathDataSerializer.cs
- EventEntry.cs
- AspNetCompatibilityRequirementsAttribute.cs
- DBCommandBuilder.cs
- HtmlInputReset.cs
- ObjectDataSourceMethodEventArgs.cs
- RegionInfo.cs
- XmlnsPrefixAttribute.cs
- ListViewDeletedEventArgs.cs
- Utils.cs
- HtmlEmptyTagControlBuilder.cs
- ContextStack.cs
- AllMembershipCondition.cs
- Queue.cs
- MetadataArtifactLoaderComposite.cs
- DbParameterCollectionHelper.cs
- FragmentNavigationEventArgs.cs
- ScriptingSectionGroup.cs
- Substitution.cs
- CssTextWriter.cs
- BamlVersionHeader.cs
- InputProviderSite.cs
- Cloud.cs
- OracleCommand.cs
- DataRecordInternal.cs
- Timeline.cs
- Queue.cs
- Imaging.cs
- InlineCollection.cs
- PropertyEntry.cs
- Visual3D.cs
- TableLayoutCellPaintEventArgs.cs
- XhtmlBasicLabelAdapter.cs
- DependencyPropertyConverter.cs
- GPStream.cs
- InstancePersistenceException.cs
- KeyValueSerializer.cs
- XamlStyleSerializer.cs
- FormsAuthenticationUserCollection.cs
- WrappedIUnknown.cs
- EntityDataSourceSelectingEventArgs.cs
- RootProfilePropertySettingsCollection.cs
- WindowsTooltip.cs
- PeerApplicationLaunchInfo.cs
- ToolStripDropTargetManager.cs
- UdpSocketReceiveManager.cs
- IIS7UserPrincipal.cs
- IdentitySection.cs
- ListGeneralPage.cs
- HttpContextServiceHost.cs
- BindingManagerDataErrorEventArgs.cs
- ComponentResourceManager.cs
- PageClientProxyGenerator.cs
- GridViewPageEventArgs.cs
- FlagsAttribute.cs
- CancelEventArgs.cs
- XmlTypeMapping.cs
- EventLogPermissionEntryCollection.cs
- WindowPattern.cs
- ConnectionManagementElementCollection.cs
- FormViewModeEventArgs.cs
- StdRegProviderWrapper.cs
- WebPartDescription.cs
- TextTreeTextBlock.cs
- PointLight.cs
- FilterQuery.cs
- SiteMapPathDesigner.cs
- Stylesheet.cs
- IISUnsafeMethods.cs
- MissingFieldException.cs
- TableLayoutRowStyleCollection.cs
- HttpStreamXmlDictionaryWriter.cs
- PieceDirectory.cs
- SyncOperationState.cs
- DataStorage.cs
- CompensatableTransactionScopeActivity.cs
- Deflater.cs
- FileDialog.cs
- PathSegment.cs
- Storyboard.cs
- LogLogRecordEnumerator.cs
- QilLiteral.cs
- AuthenticationModulesSection.cs
- RenderingEventArgs.cs
- ListenerConnectionModeReader.cs
- ScriptMethodAttribute.cs
- SmiXetterAccessMap.cs
- SmtpFailedRecipientsException.cs
- __Error.cs
- ComboBox.cs
- DataGridViewRowPrePaintEventArgs.cs
- DynamicRenderer.cs
- PropertyEmitterBase.cs
- PackWebResponse.cs
- DesignerDataSourceView.cs
- ArcSegment.cs
- COMException.cs
- ScriptManager.cs
- AsymmetricAlgorithm.cs
- Setter.cs