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
- SoapDocumentServiceAttribute.cs
- LayoutEditorPart.cs
- ApplicationActivator.cs
- PanelStyle.cs
- DataSourceControl.cs
- HwndSourceKeyboardInputSite.cs
- GenericEnumConverter.cs
- connectionpool.cs
- TypePresenter.xaml.cs
- SymLanguageVendor.cs
- SelectionPatternIdentifiers.cs
- XPathSingletonIterator.cs
- LockedActivityGlyph.cs
- XmlStringTable.cs
- ResourceExpressionEditor.cs
- InvalidEnumArgumentException.cs
- CallInfo.cs
- TextElementCollection.cs
- ConnectionProviderAttribute.cs
- SerialErrors.cs
- SQLBinary.cs
- HttpStreamFormatter.cs
- SqlFactory.cs
- HtmlControlPersistable.cs
- TextTrailingCharacterEllipsis.cs
- TextEmbeddedObject.cs
- XmlSchemaSequence.cs
- SelectionHighlightInfo.cs
- DrawingContextWalker.cs
- Sql8ExpressionRewriter.cs
- SemanticResolver.cs
- Context.cs
- BrowserCapabilitiesCodeGenerator.cs
- DiscoveryDocument.cs
- SystemUnicastIPAddressInformation.cs
- XmlSchemaDocumentation.cs
- DataGridViewCellLinkedList.cs
- WebServiceTypeData.cs
- StackOverflowException.cs
- BlobPersonalizationState.cs
- ConcurrentStack.cs
- BackgroundWorker.cs
- BackoffTimeoutHelper.cs
- FaultConverter.cs
- SortQueryOperator.cs
- UserControl.cs
- DataRecordInternal.cs
- FilteredReadOnlyMetadataCollection.cs
- Padding.cs
- SizeFConverter.cs
- NumberFormatInfo.cs
- ButtonField.cs
- DataGridBoolColumn.cs
- Rotation3D.cs
- UrlSyndicationContent.cs
- SnapshotChangeTrackingStrategy.cs
- CompatibleComparer.cs
- HtmlInputFile.cs
- InheritablePropertyChangeInfo.cs
- ViewSimplifier.cs
- GridLengthConverter.cs
- ParserStreamGeometryContext.cs
- ColumnWidthChangedEvent.cs
- DataColumnMapping.cs
- CacheAxisQuery.cs
- SimplePropertyEntry.cs
- ColumnResizeUndoUnit.cs
- _DigestClient.cs
- RegistryConfigurationProvider.cs
- Lock.cs
- SqlNode.cs
- EventlogProvider.cs
- OutputCacheProfileCollection.cs
- PerformanceCounterPermissionAttribute.cs
- RowSpanVector.cs
- TransportDefaults.cs
- MessageAction.cs
- ReferentialConstraint.cs
- QuaternionAnimation.cs
- KoreanLunisolarCalendar.cs
- BooleanAnimationUsingKeyFrames.cs
- ColumnMapProcessor.cs
- TypeElementCollection.cs
- OleDbPermission.cs
- XmlDataSourceNodeDescriptor.cs
- ContainerActivationHelper.cs
- HttpProfileBase.cs
- EntityParameter.cs
- DataReceivedEventArgs.cs
- NavigatingCancelEventArgs.cs
- TextElementCollection.cs
- OperatingSystemVersionCheck.cs
- BaseParser.cs
- _ConnectStream.cs
- DigestComparer.cs
- OdbcError.cs
- CodeMemberField.cs
- SortExpressionBuilder.cs
- MetadataUtil.cs
- Row.cs