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
- PackageDigitalSignatureManager.cs
- MenuCommand.cs
- DocumentViewerHelper.cs
- ListBox.cs
- XmlSchemaAnyAttribute.cs
- Activator.cs
- WebServiceHost.cs
- documentation.cs
- MatrixCamera.cs
- SymmetricAlgorithm.cs
- ComplexObject.cs
- XmlWrappingReader.cs
- TextTreeNode.cs
- FloaterParaClient.cs
- TraceShell.cs
- NativeMethods.cs
- ArrayList.cs
- AdornerHitTestResult.cs
- ToolBarPanel.cs
- WindowsToolbarItemAsMenuItem.cs
- SiteMapDataSource.cs
- sortedlist.cs
- PluralizationServiceUtil.cs
- SecurityPermission.cs
- FigureParaClient.cs
- recordstate.cs
- SiteMapProvider.cs
- XsdCachingReader.cs
- RTLAwareMessageBox.cs
- NonBatchDirectoryCompiler.cs
- MsmqInputMessage.cs
- DrawListViewSubItemEventArgs.cs
- SoapServerProtocol.cs
- SystemIPInterfaceProperties.cs
- SpeechDetectedEventArgs.cs
- ValidationHelpers.cs
- IdlingCommunicationPool.cs
- CodeDirectoryCompiler.cs
- AssemblyAttributesGoHere.cs
- Scheduling.cs
- EncoderReplacementFallback.cs
- BufferModesCollection.cs
- QilName.cs
- ColumnMapProcessor.cs
- WebConfigManager.cs
- CommandSet.cs
- CryptoKeySecurity.cs
- ByteAnimationBase.cs
- MetabaseServerConfig.cs
- SequenceDesigner.cs
- BinaryMethodMessage.cs
- XmlSchemaImporter.cs
- NativeMethods.cs
- ProtocolElementCollection.cs
- RawStylusSystemGestureInputReport.cs
- UnsafeNativeMethods.cs
- RectangleGeometry.cs
- AttachmentCollection.cs
- NameValueConfigurationCollection.cs
- UnicodeEncoding.cs
- HostedAspNetEnvironment.cs
- ToolStripItem.cs
- WebControlToolBoxItem.cs
- ViewStateModeByIdAttribute.cs
- CodeGeneratorAttribute.cs
- HtmlHead.cs
- OverlappedAsyncResult.cs
- AppDomainGrammarProxy.cs
- CollectionDataContract.cs
- XmlElementAttributes.cs
- PromptEventArgs.cs
- InternalBase.cs
- Size.cs
- StyleSheetComponentEditor.cs
- XmlSchemaSequence.cs
- DataGridViewLinkCell.cs
- XmlSchemaChoice.cs
- WebFaultClientMessageInspector.cs
- ConstructorNeedsTagAttribute.cs
- TemplateComponentConnector.cs
- ISessionStateStore.cs
- OdbcHandle.cs
- PassportAuthenticationEventArgs.cs
- ProviderBase.cs
- MemberCollection.cs
- PropertyItem.cs
- DetailsViewInsertEventArgs.cs
- OleDbConnection.cs
- DesigntimeLicenseContext.cs
- ellipse.cs
- CodeDelegateCreateExpression.cs
- SmtpFailedRecipientsException.cs
- EntityDataSourceMemberPath.cs
- SelectQueryOperator.cs
- XmlSchemaSet.cs
- LinqDataSourceView.cs
- TimeIntervalCollection.cs
- Scripts.cs
- BoundColumn.cs
- FontEmbeddingManager.cs