Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / ResetableIterator.cs / 1305376 / ResetableIterator.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 abstract class ResetableIterator : XPathNodeIterator { // the best place for this constructors to be is XPathNodeIterator, to avoid DCR at this time let's ground them here public ResetableIterator() { base.count = -1; } protected ResetableIterator(ResetableIterator other) { base.count = other.count; } protected void ResetCount() { base.count = -1; } public abstract void Reset(); public virtual bool MoveToPosition(int pos) { Reset(); for(int i = CurrentPosition; i < pos ; i ++) { if(!MoveNext()) { return false; } } return true; } // Contruct extension: CurrentPosition should return 0 if MoveNext() wasn't called after Reset() // (behavior is not defined for XPathNodeIterator) public abstract override int CurrentPosition { get; } } } // 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 abstract class ResetableIterator : XPathNodeIterator { // the best place for this constructors to be is XPathNodeIterator, to avoid DCR at this time let's ground them here public ResetableIterator() { base.count = -1; } protected ResetableIterator(ResetableIterator other) { base.count = other.count; } protected void ResetCount() { base.count = -1; } public abstract void Reset(); public virtual bool MoveToPosition(int pos) { Reset(); for(int i = CurrentPosition; i < pos ; i ++) { if(!MoveNext()) { return false; } } return true; } // Contruct extension: CurrentPosition should return 0 if MoveNext() wasn't called after Reset() // (behavior is not defined for XPathNodeIterator) public abstract override int CurrentPosition { get; } } } // 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
- NumberFormatInfo.cs
- CacheMemory.cs
- JsonQNameDataContract.cs
- SplineKeyFrames.cs
- EditorZoneBase.cs
- GlobalDataBindingHandler.cs
- UserControlCodeDomTreeGenerator.cs
- XmlDocument.cs
- StylusButtonCollection.cs
- ThumbAutomationPeer.cs
- BindingMemberInfo.cs
- VariantWrapper.cs
- WindowsStatic.cs
- DBCSCodePageEncoding.cs
- DataRowView.cs
- SplayTreeNode.cs
- ObjectManager.cs
- CategoryValueConverter.cs
- Model3DCollection.cs
- ResolveDuplexAsyncResult.cs
- DotAtomReader.cs
- WindowsToolbarAsMenu.cs
- SharedStatics.cs
- UIHelper.cs
- TransformerInfoCollection.cs
- SqlGenerator.cs
- HtmlGenericControl.cs
- SimpleApplicationHost.cs
- VerificationAttribute.cs
- EncoderNLS.cs
- BrowsableAttribute.cs
- UserControl.cs
- ProfileGroupSettings.cs
- FloaterBaseParaClient.cs
- BuildProvidersCompiler.cs
- GlobalizationSection.cs
- ClipboardData.cs
- ColumnClickEvent.cs
- FontStyleConverter.cs
- DataGridViewSelectedCellCollection.cs
- RestClientProxyHandler.cs
- ClockController.cs
- Set.cs
- MultitargetUtil.cs
- versioninfo.cs
- BitmapCodecInfo.cs
- BamlLocalizableResourceKey.cs
- EventProvider.cs
- SystemSounds.cs
- DropDownList.cs
- RectConverter.cs
- DataSet.cs
- FocusWithinProperty.cs
- Model3D.cs
- TreeNodeBindingCollection.cs
- SafeNativeMethods.cs
- NamedPipeProcessProtocolHandler.cs
- NotImplementedException.cs
- InputLangChangeRequestEvent.cs
- StringPropertyBuilder.cs
- BindingManagerDataErrorEventArgs.cs
- MailWebEventProvider.cs
- TripleDESCryptoServiceProvider.cs
- MenuItemCollection.cs
- X509ChainPolicy.cs
- XmlSchemaAppInfo.cs
- IgnoreSectionHandler.cs
- DrawingVisual.cs
- UTF8Encoding.cs
- SqlProviderUtilities.cs
- LogExtent.cs
- ImageListStreamer.cs
- WebPartsSection.cs
- DesignerAdRotatorAdapter.cs
- ThreadAttributes.cs
- BridgeDataRecord.cs
- DataRelationCollection.cs
- StyleSheet.cs
- FontEmbeddingManager.cs
- InputBinding.cs
- ServiceContractDetailViewControl.cs
- ScrollChrome.cs
- AttributeAction.cs
- Rect3D.cs
- ToolStripLocationCancelEventArgs.cs
- Trustee.cs
- TextEditorCopyPaste.cs
- IODescriptionAttribute.cs
- IItemContainerGenerator.cs
- Tablet.cs
- RijndaelManagedTransform.cs
- TextParagraphProperties.cs
- StrongNameIdentityPermission.cs
- CompositeCollectionView.cs
- safelink.cs
- HandlerBase.cs
- UnescapedXmlDiagnosticData.cs
- CollectionViewGroupRoot.cs
- BuilderPropertyEntry.cs
- PackageRelationship.cs