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 / XPathSelectionIterator.cs / 1 / XPathSelectionIterator.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; // We need this wrapper object to: // 1. Calculate position // 2. Protect internal query.Current from user who may call MoveNext(). internal class XPathSelectionIterator : ResetableIterator { private XPathNavigator nav; private Query query; private int position; internal XPathSelectionIterator(XPathNavigator nav, Query query) { this.nav = nav.Clone(); this.query = query; } protected XPathSelectionIterator(XPathSelectionIterator it) { this.nav = it.nav.Clone(); this.query = (Query) it.query.Clone(); this.position = it.position; } public override void Reset() { this.query.Reset(); } public override bool MoveNext() { XPathNavigator n = query.Advance(); if( n != null ) { position++; if (!nav.MoveTo(n)) { nav = n.Clone(); } return true; } return false; } public override int Count { get { return query.Count; } } public override XPathNavigator Current { get { return nav; } } public override int CurrentPosition { get { return position; } } public override XPathNodeIterator Clone() { return new XPathSelectionIterator(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; // We need this wrapper object to: // 1. Calculate position // 2. Protect internal query.Current from user who may call MoveNext(). internal class XPathSelectionIterator : ResetableIterator { private XPathNavigator nav; private Query query; private int position; internal XPathSelectionIterator(XPathNavigator nav, Query query) { this.nav = nav.Clone(); this.query = query; } protected XPathSelectionIterator(XPathSelectionIterator it) { this.nav = it.nav.Clone(); this.query = (Query) it.query.Clone(); this.position = it.position; } public override void Reset() { this.query.Reset(); } public override bool MoveNext() { XPathNavigator n = query.Advance(); if( n != null ) { position++; if (!nav.MoveTo(n)) { nav = n.Clone(); } return true; } return false; } public override int Count { get { return query.Count; } } public override XPathNavigator Current { get { return nav; } } public override int CurrentPosition { get { return position; } } public override XPathNodeIterator Clone() { return new XPathSelectionIterator(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
- KeyMatchBuilder.cs
- ConstraintConverter.cs
- DataGridViewColumnCollection.cs
- Size3D.cs
- XdrBuilder.cs
- RadioButtonRenderer.cs
- QilStrConcat.cs
- HelpKeywordAttribute.cs
- StringFunctions.cs
- StrokeNodeEnumerator.cs
- PerformanceCounterCategory.cs
- SmtpLoginAuthenticationModule.cs
- CodeMemberMethod.cs
- TableLayoutSettingsTypeConverter.cs
- TreeNodeStyle.cs
- CustomSignedXml.cs
- EntityKeyElement.cs
- MsmqProcessProtocolHandler.cs
- Parameter.cs
- UpWmlMobileTextWriter.cs
- XmlRootAttribute.cs
- metadatamappinghashervisitor.cs
- DecoratedNameAttribute.cs
- BeginStoryboard.cs
- XmlCountingReader.cs
- BaseDataBoundControl.cs
- FormViewPageEventArgs.cs
- DropShadowBitmapEffect.cs
- LogicalExpressionTypeConverter.cs
- FunctionDescription.cs
- ContentIterators.cs
- EntityProviderServices.cs
- FileIOPermission.cs
- PreservationFileReader.cs
- NotifyParentPropertyAttribute.cs
- FileDialog_Vista_Interop.cs
- EllipseGeometry.cs
- Double.cs
- sqlmetadatafactory.cs
- InvalidEnumArgumentException.cs
- SqlMethodAttribute.cs
- GreenMethods.cs
- DataGridItemCollection.cs
- ListBoxChrome.cs
- SqlParameterCollection.cs
- DbCommandTree.cs
- ScrollItemPatternIdentifiers.cs
- VisualBrush.cs
- Utils.cs
- RolePrincipal.cs
- StringKeyFrameCollection.cs
- UserThread.cs
- ToolStripHighContrastRenderer.cs
- XmlNodeReader.cs
- regiisutil.cs
- WebConfigurationManager.cs
- VersionedStream.cs
- XmlEncodedRawTextWriter.cs
- ArrayWithOffset.cs
- LocalizeDesigner.cs
- EventLogPermissionEntry.cs
- ContractUtils.cs
- CompositionTarget.cs
- InstanceLockedException.cs
- SecurityMode.cs
- InstalledVoice.cs
- DocumentGridPage.cs
- SqlNotificationEventArgs.cs
- RemoteHelper.cs
- WebPartsPersonalizationAuthorization.cs
- NetworkAddressChange.cs
- ToolCreatedEventArgs.cs
- CompositeScriptReference.cs
- RealProxy.cs
- EnumConverter.cs
- AsyncDataRequest.cs
- StylusPointDescription.cs
- BaseResourcesBuildProvider.cs
- IResourceProvider.cs
- CustomValidator.cs
- SynchronousChannel.cs
- NativeMethodsOther.cs
- FamilyMapCollection.cs
- FontFamilyIdentifier.cs
- FastPropertyAccessor.cs
- MenuEventArgs.cs
- HtmlControlAdapter.cs
- PromptEventArgs.cs
- SecurityContextCookieSerializer.cs
- BypassElement.cs
- ScrollChrome.cs
- WindowsListView.cs
- RangeValidator.cs
- ResourceReferenceKeyNotFoundException.cs
- XmlValidatingReaderImpl.cs
- HeaderUtility.cs
- CompressionTracing.cs
- CodeCommentStatement.cs
- StylusPointPropertyInfoDefaults.cs
- DbConnectionPool.cs