Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Xml / System / Xml / XPath / Internal / ResetableIterator.cs / 1 / 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
- HMACSHA512.cs
- FormParameter.cs
- DataGridRow.cs
- TextServicesManager.cs
- XmlLinkedNode.cs
- FrameworkContextData.cs
- SqlParameter.cs
- GradientSpreadMethodValidation.cs
- DataRowChangeEvent.cs
- MainMenu.cs
- SmiTypedGetterSetter.cs
- XmlSchemaCollection.cs
- AttributeCollection.cs
- SynchronizedDisposablePool.cs
- DetailsViewCommandEventArgs.cs
- SocketPermission.cs
- XmlObjectSerializerReadContextComplex.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- XmlTypeAttribute.cs
- ProviderConnectionPointCollection.cs
- Stroke.cs
- ContentOperations.cs
- DiagnosticTrace.cs
- ConnectionStringsExpressionBuilder.cs
- VolatileEnlistmentMultiplexing.cs
- glyphs.cs
- RangeContentEnumerator.cs
- StringValueSerializer.cs
- AnnotationDocumentPaginator.cs
- BitmapEffect.cs
- MemberPathMap.cs
- _PooledStream.cs
- ZeroOpNode.cs
- ToolBarTray.cs
- ConfigurationManagerInternalFactory.cs
- XsltLibrary.cs
- ItemCollectionEditor.cs
- TemplateBuilder.cs
- RegexNode.cs
- QilUnary.cs
- StatusBarDrawItemEvent.cs
- documentation.cs
- SqlBuffer.cs
- CodeMemberProperty.cs
- MLangCodePageEncoding.cs
- EndpointFilterProvider.cs
- GridViewSortEventArgs.cs
- TimestampInformation.cs
- CopyNodeSetAction.cs
- JsonClassDataContract.cs
- SchemaObjectWriter.cs
- ProfessionalColorTable.cs
- BitmapEffectInput.cs
- ConnectionConsumerAttribute.cs
- PersonalizationStateInfo.cs
- httpapplicationstate.cs
- CodeCastExpression.cs
- Vector3DIndependentAnimationStorage.cs
- WorkflowValidationFailedException.cs
- CommentEmitter.cs
- GridViewUpdateEventArgs.cs
- SurrogateEncoder.cs
- InternalDuplexBindingElement.cs
- ArraySegment.cs
- EntityViewGenerationAttribute.cs
- BitmapEditor.cs
- SystemWebCachingSectionGroup.cs
- FrameworkContentElement.cs
- ReadContentAsBinaryHelper.cs
- behaviorssection.cs
- XmlNodeChangedEventManager.cs
- FixedSOMLineCollection.cs
- GeneralTransform2DTo3D.cs
- StringValidator.cs
- SiteOfOriginPart.cs
- LicenseException.cs
- DatePickerDateValidationErrorEventArgs.cs
- PropertyDescriptors.cs
- LogStream.cs
- SqlWriter.cs
- NotifyInputEventArgs.cs
- WebPartConnectionsEventArgs.cs
- Transform.cs
- SponsorHelper.cs
- MessageBox.cs
- OutputCacheProfileCollection.cs
- DirectoryObjectSecurity.cs
- _ListenerResponseStream.cs
- Context.cs
- InternalsVisibleToAttribute.cs
- XmlUtf8RawTextWriter.cs
- FieldDescriptor.cs
- EntityDesignerDataSourceView.cs
- ExceptionAggregator.cs
- ClientConvert.cs
- RenderDataDrawingContext.cs
- SortQueryOperator.cs
- BitmapInitialize.cs
- XmlEntity.cs
- UIElementAutomationPeer.cs