Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Attributes.cs
- UIElementHelper.cs
- MultipartContentParser.cs
- ReadOnlyHierarchicalDataSource.cs
- ToolStripLocationCancelEventArgs.cs
- diagnosticsswitches.cs
- CompareInfo.cs
- FlowNode.cs
- DrawingContextFlattener.cs
- TreeNodeBinding.cs
- ExpressionBuilderCollection.cs
- DSASignatureFormatter.cs
- GridViewSelectEventArgs.cs
- OdbcStatementHandle.cs
- TypeContext.cs
- FSWPathEditor.cs
- SignerInfo.cs
- DbDataSourceEnumerator.cs
- ComponentEvent.cs
- OutOfProcStateClientManager.cs
- QilList.cs
- Line.cs
- CodeSnippetTypeMember.cs
- Serializer.cs
- UserNameSecurityTokenAuthenticator.cs
- ChannelSettingsElement.cs
- SoapTypeAttribute.cs
- ColorTranslator.cs
- HwndMouseInputProvider.cs
- CfgParser.cs
- initElementDictionary.cs
- assemblycache.cs
- Cloud.cs
- ACL.cs
- SoundPlayerAction.cs
- BoundsDrawingContextWalker.cs
- ProcessModelInfo.cs
- SimpleWebHandlerParser.cs
- AutoCompleteStringCollection.cs
- IHttpResponseInternal.cs
- SolidColorBrush.cs
- CapiNative.cs
- FormsAuthenticationConfiguration.cs
- Underline.cs
- ScriptingJsonSerializationSection.cs
- TypeUtil.cs
- nulltextnavigator.cs
- DbConnectionStringCommon.cs
- XmlHierarchicalDataSourceView.cs
- WorkflowMarkupSerializationProvider.cs
- XmlCharCheckingWriter.cs
- ToolBarButtonClickEvent.cs
- RightsManagementEncryptedStream.cs
- CodeCatchClauseCollection.cs
- SqlGenericUtil.cs
- ApplicationSecurityManager.cs
- AppSettingsSection.cs
- DefaultBindingPropertyAttribute.cs
- DataObjectPastingEventArgs.cs
- OverflowException.cs
- SmiSettersStream.cs
- ObjectListCommandsPage.cs
- CalendarTable.cs
- __Filters.cs
- BasicViewGenerator.cs
- BuildProviderAppliesToAttribute.cs
- SystemNetHelpers.cs
- Attributes.cs
- Switch.cs
- RuleElement.cs
- MasterPage.cs
- MetadataArtifactLoaderFile.cs
- WindowsRebar.cs
- COSERVERINFO.cs
- IIS7UserPrincipal.cs
- TextComposition.cs
- NativeMethods.cs
- DbExpressionVisitor.cs
- StrokeIntersection.cs
- Resources.Designer.cs
- WmlSelectionListAdapter.cs
- XPathLexer.cs
- WindowsScrollBarBits.cs
- EventLogPermissionEntryCollection.cs
- TimeSpanMinutesConverter.cs
- TaiwanLunisolarCalendar.cs
- AsymmetricAlgorithm.cs
- BidPrivateBase.cs
- ResourceAssociationType.cs
- HtmlEncodedRawTextWriter.cs
- SamlConditions.cs
- WindowInteractionStateTracker.cs
- ReadWriteSpinLock.cs
- ImportContext.cs
- StatusBar.cs
- EntityDataSourceContextDisposingEventArgs.cs
- ImageCollectionEditor.cs
- InvokeDelegate.cs
- DecimalAnimationBase.cs
- DataServiceQueryContinuation.cs