Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathAncestorIterator.cs / 1305376 / 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
- InternalDispatchObject.cs
- NullableIntAverageAggregationOperator.cs
- Composition.cs
- DesignerImageAdapter.cs
- List.cs
- StatusBar.cs
- BrowserDefinition.cs
- MergeFilterQuery.cs
- Application.cs
- XmlImplementation.cs
- Compilation.cs
- DockAndAnchorLayout.cs
- TimerElapsedEvenArgs.cs
- XLinq.cs
- ControlBindingsCollection.cs
- Accessors.cs
- ButtonBaseDesigner.cs
- ListViewGroupItemCollection.cs
- StackBuilderSink.cs
- RenderingBiasValidation.cs
- Win32SafeHandles.cs
- ObjectSpanRewriter.cs
- CryptoApi.cs
- NameTable.cs
- HostingEnvironmentSection.cs
- CustomAttributeSerializer.cs
- Assembly.cs
- Normalization.cs
- XmlElement.cs
- SQLInt32.cs
- IPHostEntry.cs
- EncoderReplacementFallback.cs
- AsyncOperation.cs
- DesignerOptionService.cs
- MappingModelBuildProvider.cs
- DefaultCommandConverter.cs
- HtmlControl.cs
- PKCS1MaskGenerationMethod.cs
- CommandExpr.cs
- TextTabProperties.cs
- X509Extension.cs
- ParamArrayAttribute.cs
- Attributes.cs
- MessageQueueException.cs
- PointIndependentAnimationStorage.cs
- DataBoundControlAdapter.cs
- CryptoKeySecurity.cs
- Util.cs
- PinnedBufferMemoryStream.cs
- DuplicateWaitObjectException.cs
- SpeechSeg.cs
- AudioDeviceOut.cs
- WhileDesigner.xaml.cs
- VectorAnimationUsingKeyFrames.cs
- ModelItem.cs
- TraceRecord.cs
- LambdaCompiler.ControlFlow.cs
- PermissionRequestEvidence.cs
- DTCTransactionManager.cs
- ThemeInfoAttribute.cs
- MethodImplAttribute.cs
- DoubleSumAggregationOperator.cs
- TextElement.cs
- ContextItemManager.cs
- WindowsRichEditRange.cs
- Pen.cs
- UnicastIPAddressInformationCollection.cs
- CombinedHttpChannel.cs
- keycontainerpermission.cs
- GroupBox.cs
- OutputChannelBinder.cs
- XPathParser.cs
- EnumValAlphaComparer.cs
- StandardOleMarshalObject.cs
- DbModificationClause.cs
- EntityUtil.cs
- BindingMemberInfo.cs
- FactoryId.cs
- XmlSchemaParticle.cs
- ConfigurationManagerInternalFactory.cs
- SqlCommand.cs
- HTMLTagNameToTypeMapper.cs
- RangeValuePattern.cs
- Permission.cs
- CodeMethodReturnStatement.cs
- SevenBitStream.cs
- Point3DCollection.cs
- InputDevice.cs
- ExpanderAutomationPeer.cs
- DatatypeImplementation.cs
- PropertyReferenceExtension.cs
- TransactionScope.cs
- Propagator.JoinPropagator.cs
- TriggerAction.cs
- OneToOneMappingSerializer.cs
- EntityContainerEmitter.cs
- Vector3DCollection.cs
- InlineObject.cs
- GatewayDefinition.cs
- NotSupportedException.cs