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
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- mediaeventshelper.cs
- __TransparentProxy.cs
- SubpageParagraph.cs
- QueryNode.cs
- SplitterPanel.cs
- DependencyPropertyChangedEventArgs.cs
- EntryIndex.cs
- MetadataArtifactLoader.cs
- MessageFilter.cs
- OperationFormatStyle.cs
- SqlDelegatedTransaction.cs
- StylusPointProperty.cs
- ProvidersHelper.cs
- RMEnrollmentPage3.cs
- ObjectStateFormatter.cs
- FontFamily.cs
- DirectoryGroupQuery.cs
- sortedlist.cs
- MessageEventSubscriptionService.cs
- OleDbParameterCollection.cs
- CodeNamespaceCollection.cs
- WebServiceBindingAttribute.cs
- BitmapSource.cs
- ProxyHwnd.cs
- UIElement3D.cs
- RealizedColumnsBlock.cs
- DataGridItemCollection.cs
- RouteTable.cs
- XmlDomTextWriter.cs
- XmlNotation.cs
- WebPartManagerInternals.cs
- GeometryCombineModeValidation.cs
- ProfileSettingsCollection.cs
- ProgressBarAutomationPeer.cs
- DesignerView.Commands.cs
- AnchoredBlock.cs
- CharacterMetricsDictionary.cs
- DataGridViewCellStyleChangedEventArgs.cs
- MessageBodyDescription.cs
- COM2ColorConverter.cs
- DbParameterHelper.cs
- updateconfighost.cs
- EntityStoreSchemaGenerator.cs
- FlowDocumentView.cs
- CriticalHandle.cs
- DataGridViewRow.cs
- SortedList.cs
- WizardStepCollectionEditor.cs
- HtmlInputCheckBox.cs
- DropDownList.cs
- ToolboxComponentsCreatingEventArgs.cs
- MessageHeaders.cs
- ProcessHostConfigUtils.cs
- Light.cs
- DataGridViewRowsAddedEventArgs.cs
- FormatConvertedBitmap.cs
- SectionInput.cs
- TemplateControlBuildProvider.cs
- initElementDictionary.cs
- PagesSection.cs
- _AuthenticationState.cs
- GeometryCombineModeValidation.cs
- IgnoreFileBuildProvider.cs
- NavigationCommands.cs
- InvokePattern.cs
- WindowsRegion.cs
- _NetworkingPerfCounters.cs
- WebBrowserNavigatedEventHandler.cs
- EntityDataSourceDesigner.cs
- DesignerActionService.cs
- ApplicationServiceHelper.cs
- GetIndexBinder.cs
- WeakReferenceEnumerator.cs
- HtmlTextBoxAdapter.cs
- AutomationAttributeInfo.cs
- DelayedRegex.cs
- WsdlImporterElementCollection.cs
- CircleEase.cs
- DataGridPagerStyle.cs
- PolyBezierSegmentFigureLogic.cs
- SemanticResolver.cs
- VersionConverter.cs
- ParentQuery.cs
- ETagAttribute.cs
- PersonalizationStateInfoCollection.cs
- AuthorizationRule.cs
- PermissionSetTriple.cs
- ScriptResourceInfo.cs
- CompilerError.cs
- CardSpaceException.cs
- ActiveXHelper.cs
- MediaElement.cs
- CounterCreationData.cs
- OleDbException.cs
- ColumnTypeConverter.cs
- ManagementClass.cs
- SqlProfileProvider.cs
- EncodedStreamFactory.cs
- XmlILIndex.cs