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
- SafeProcessHandle.cs
- SessionStateContainer.cs
- Stopwatch.cs
- XmlTextAttribute.cs
- XmlIlGenerator.cs
- RecognitionResult.cs
- Exception.cs
- GreenMethods.cs
- DebugInfoGenerator.cs
- ServiceProviders.cs
- InputDevice.cs
- TaskFileService.cs
- ManagementQuery.cs
- MenuScrollingVisibilityConverter.cs
- PhysicalFontFamily.cs
- ConfigurationCollectionAttribute.cs
- SecurityTokenSerializer.cs
- FileSecurity.cs
- GridViewUpdatedEventArgs.cs
- CodeGotoStatement.cs
- SqlParameterizer.cs
- HttpPostedFileBase.cs
- DeferredReference.cs
- HtmlTextArea.cs
- BufferedReadStream.cs
- EventSinkActivityDesigner.cs
- httpapplicationstate.cs
- CqlParser.cs
- SchemaImporter.cs
- ComplexLine.cs
- CompositeDuplexElement.cs
- CounterSample.cs
- Buffer.cs
- QilNode.cs
- MediaTimeline.cs
- Font.cs
- DataGridParentRows.cs
- MouseActionConverter.cs
- TextDocumentView.cs
- BrowserTree.cs
- CompilerState.cs
- ServicePoint.cs
- BitmapEffectDrawingContextState.cs
- ZipPackage.cs
- IgnoreFlushAndCloseStream.cs
- StructuralObject.cs
- XmlWrappingReader.cs
- SequenceDesigner.cs
- WpfKnownMemberInvoker.cs
- CheckBoxBaseAdapter.cs
- ModuleBuilder.cs
- InternalUserCancelledException.cs
- RowParagraph.cs
- Helper.cs
- XmlSigningNodeWriter.cs
- securitycriticaldataformultiplegetandset.cs
- ToolStripItemClickedEventArgs.cs
- ChildrenQuery.cs
- DataMemberFieldEditor.cs
- StorageAssociationSetMapping.cs
- MsmqChannelListenerBase.cs
- RoutingEndpointTrait.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- SystemIcmpV6Statistics.cs
- CellNormalizer.cs
- HMACMD5.cs
- DesignerActionUIService.cs
- LookupBindingPropertiesAttribute.cs
- ComplexTypeEmitter.cs
- KnownBoxes.cs
- AutomationElementCollection.cs
- ObjectContextServiceProvider.cs
- codemethodreferenceexpression.cs
- SchemaHelper.cs
- ValueTable.cs
- EditorAttribute.cs
- UnmanagedHandle.cs
- MinMaxParagraphWidth.cs
- ExtensionQuery.cs
- AsyncOperationContext.cs
- SynchronizingStream.cs
- ObjectItemCollection.cs
- CodeSnippetCompileUnit.cs
- ClientSettingsStore.cs
- FormsAuthenticationCredentials.cs
- Msmq4PoisonHandler.cs
- ServiceHostFactory.cs
- GlobalAllocSafeHandle.cs
- ImageKeyConverter.cs
- MultiTouchSystemGestureLogic.cs
- EntityCollection.cs
- TransformCollection.cs
- AssemblyFilter.cs
- ViewManager.cs
- DataGridTextBox.cs
- Bitmap.cs
- AssemblyHash.cs
- RectangleF.cs
- ChangeConflicts.cs
- DataServiceExpressionVisitor.cs