Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- XmlSchemaSimpleType.cs
- InstanceCollisionException.cs
- RecognitionResult.cs
- XPathAxisIterator.cs
- X509CertificateCollection.cs
- EdmProviderManifest.cs
- NullEntityWrapper.cs
- DesignerSerializationVisibilityAttribute.cs
- DataChangedEventManager.cs
- BufferAllocator.cs
- DeflateEmulationStream.cs
- DigestTraceRecordHelper.cs
- Int32AnimationUsingKeyFrames.cs
- TemplateControlBuildProvider.cs
- DesignParameter.cs
- NamedPermissionSet.cs
- ActivityPreviewDesigner.cs
- HttpResponseInternalWrapper.cs
- IdentitySection.cs
- DataQuery.cs
- ForceCopyBuildProvider.cs
- NamedObject.cs
- TCPListener.cs
- AuthenticationException.cs
- SortQuery.cs
- CompiledXpathExpr.cs
- SparseMemoryStream.cs
- CompiledWorkflowDefinitionContext.cs
- SimpleLine.cs
- StrokeIntersection.cs
- TextTreeUndoUnit.cs
- UnmanagedMemoryStream.cs
- SourceSwitch.cs
- HttpServerProtocol.cs
- DotNetATv1WindowsLogEntrySerializer.cs
- EditorZone.cs
- Queue.cs
- InputMethodStateTypeInfo.cs
- SpeechRecognitionEngine.cs
- TickBar.cs
- TransformPattern.cs
- DataContractAttribute.cs
- MimeMapping.cs
- BaseTemplateCodeDomTreeGenerator.cs
- DesignerVerb.cs
- FormViewInsertedEventArgs.cs
- XmlDocumentSerializer.cs
- TraceLevelStore.cs
- XmlElementAttribute.cs
- WindowsFont.cs
- TableStyle.cs
- ConnectionConsumerAttribute.cs
- WebReferencesBuildProvider.cs
- ObjectItemCollection.cs
- StateManagedCollection.cs
- SQLCharsStorage.cs
- DbCommandTree.cs
- GeometryModel3D.cs
- JsonEncodingStreamWrapper.cs
- XPathNodeInfoAtom.cs
- MessageQueueKey.cs
- LinqToSqlWrapper.cs
- NamespaceQuery.cs
- OperationInvokerBehavior.cs
- Identity.cs
- MouseEventArgs.cs
- SystemUdpStatistics.cs
- WindowManager.cs
- TraceInternal.cs
- ContentType.cs
- MemoryPressure.cs
- PreloadHost.cs
- ComPlusTypeLoader.cs
- DependencyPropertyHelper.cs
- OleDbWrapper.cs
- BatchParser.cs
- Vector3DKeyFrameCollection.cs
- XmlReflectionImporter.cs
- SelectingProviderEventArgs.cs
- IisTraceWebEventProvider.cs
- TreeWalkHelper.cs
- ExcludePathInfo.cs
- ColorConverter.cs
- FilteredReadOnlyMetadataCollection.cs
- TraceSection.cs
- XmlAtomErrorReader.cs
- CodeVariableReferenceExpression.cs
- DataStreams.cs
- KeyPressEvent.cs
- StandardToolWindows.cs
- QueryableFilterUserControl.cs
- ColumnResizeAdorner.cs
- InputElement.cs
- PackageProperties.cs
- followingsibling.cs
- TimeoutHelper.cs
- ToolStripContentPanel.cs
- EventLog.cs
- EventTrigger.cs
- DescendentsWalker.cs