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
- BrowserDefinition.cs
- DefaultEvaluationContext.cs
- Compress.cs
- CompositeActivityCodeGenerator.cs
- LinkLabel.cs
- ModifierKeysConverter.cs
- RtType.cs
- DBParameter.cs
- MediaTimeline.cs
- Trace.cs
- LinqDataSourceStatusEventArgs.cs
- URIFormatException.cs
- CustomError.cs
- Line.cs
- NameTable.cs
- HttpListenerPrefixCollection.cs
- MenuItem.cs
- Single.cs
- ProtocolsConfigurationEntry.cs
- Transform.cs
- SQLMembershipProvider.cs
- StringResourceManager.cs
- SelectingProviderEventArgs.cs
- DefaultConfirmation.cs
- SpanIndex.cs
- ByteStreamMessageUtility.cs
- PtsContext.cs
- SessionEndedEventArgs.cs
- QuaternionValueSerializer.cs
- ReadWriteObjectLock.cs
- KeyValuePair.cs
- SelectionHighlightInfo.cs
- WebPartPersonalization.cs
- XmlSerializerVersionAttribute.cs
- DropShadowBitmapEffect.cs
- EventBuilder.cs
- baseaxisquery.cs
- BaseAddressPrefixFilterElement.cs
- SQLChars.cs
- HitTestFilterBehavior.cs
- EventProvider.cs
- DynamicPropertyReader.cs
- ListViewItem.cs
- _NetworkingPerfCounters.cs
- MultiPropertyDescriptorGridEntry.cs
- SettingsProviderCollection.cs
- ChangeNode.cs
- Point3DAnimationBase.cs
- MessageQueue.cs
- WebPartExportVerb.cs
- EdmComplexPropertyAttribute.cs
- Panel.cs
- AsyncPostBackErrorEventArgs.cs
- Panel.cs
- SafeNativeMemoryHandle.cs
- base64Transforms.cs
- _DigestClient.cs
- OleDbStruct.cs
- InternalException.cs
- NavigationPropertyAccessor.cs
- Permission.cs
- ModuleBuilderData.cs
- RuleConditionDialog.cs
- cryptoapiTransform.cs
- ZoneMembershipCondition.cs
- XmlReader.cs
- SqlClientWrapperSmiStream.cs
- ToolBar.cs
- DefinitionUpdate.cs
- ExpressionLexer.cs
- EntityDataReader.cs
- MobileListItem.cs
- WebBrowserUriTypeConverter.cs
- ObjectQuery_EntitySqlExtensions.cs
- PropertyGeneratedEventArgs.cs
- _IPv6Address.cs
- FederatedMessageSecurityOverHttpElement.cs
- ProcessThread.cs
- OrderablePartitioner.cs
- RegistrationContext.cs
- SmiEventSink.cs
- DataServiceSaveChangesEventArgs.cs
- TimeSpanOrInfiniteValidator.cs
- PrefixQName.cs
- AssociatedControlConverter.cs
- DataGridViewRowCancelEventArgs.cs
- CorrelationToken.cs
- AttributeUsageAttribute.cs
- SecurityTokenAttachmentMode.cs
- TextEmbeddedObject.cs
- XmlTypeAttribute.cs
- RuntimeIdentifierPropertyAttribute.cs
- XmlSchemaDocumentation.cs
- BaseDataList.cs
- TextRangeBase.cs
- DataObject.cs
- OdbcDataReader.cs
- SafeCertificateContext.cs
- GenerateTemporaryTargetAssembly.cs
- BitConverter.cs