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
- _LazyAsyncResult.cs
- DataGridViewLinkCell.cs
- SqlCacheDependencyDatabaseCollection.cs
- CapabilitiesPattern.cs
- SoundPlayerAction.cs
- TextFormattingConverter.cs
- CodeDirectoryCompiler.cs
- SourceElementsCollection.cs
- SafeSecurityHandles.cs
- XmlCDATASection.cs
- TabControlToolboxItem.cs
- DecimalSumAggregationOperator.cs
- WeakEventTable.cs
- DecryptRequest.cs
- QueryConverter.cs
- ListView.cs
- CmsInterop.cs
- RemoteWebConfigurationHostStream.cs
- DataListItem.cs
- CTreeGenerator.cs
- PointAnimation.cs
- FormViewCommandEventArgs.cs
- EnumValAlphaComparer.cs
- CanonicalFontFamilyReference.cs
- FacetDescription.cs
- InlineObject.cs
- DataGridViewCellConverter.cs
- XamlFilter.cs
- DictionaryBase.cs
- UserControl.cs
- FileAuthorizationModule.cs
- FillErrorEventArgs.cs
- FormatConvertedBitmap.cs
- RuntimeResourceSet.cs
- figurelength.cs
- XmlILModule.cs
- Material.cs
- MobileSysDescriptionAttribute.cs
- CodeDOMUtility.cs
- TextChangedEventArgs.cs
- CodeFieldReferenceExpression.cs
- OpenTypeLayoutCache.cs
- ToolStripDropDownClosingEventArgs.cs
- TraceProvider.cs
- StylusPointPropertyInfo.cs
- CellParagraph.cs
- ExecutionContext.cs
- FormViewUpdateEventArgs.cs
- FirstQueryOperator.cs
- HttpBufferlessInputStream.cs
- AgileSafeNativeMemoryHandle.cs
- HttpDebugHandler.cs
- DataGrid.cs
- ComponentCache.cs
- SelectionEditingBehavior.cs
- HttpListenerException.cs
- FlowLayoutPanel.cs
- Rect.cs
- WindowsStartMenu.cs
- TextDecorationCollectionConverter.cs
- Rectangle.cs
- ImageAttributes.cs
- LinqDataSourceInsertEventArgs.cs
- SqlFacetAttribute.cs
- BufferedStream.cs
- AggregationMinMaxHelpers.cs
- XmlSchemaComplexContentExtension.cs
- CryptoKeySecurity.cs
- EntityUtil.cs
- DrawingImage.cs
- LeaseManager.cs
- IRCollection.cs
- ToolStripSeparator.cs
- BackgroundWorker.cs
- BufferModeSettings.cs
- SystemPens.cs
- SQLDecimalStorage.cs
- IApplicationTrustManager.cs
- ObjectView.cs
- ImageMapEventArgs.cs
- LinkedDataMemberFieldEditor.cs
- CryptoStream.cs
- Int16Storage.cs
- basevalidator.cs
- CompositeActivityValidator.cs
- ViewGenResults.cs
- TemplateBindingExpressionConverter.cs
- future.cs
- StringInfo.cs
- ComboBoxDesigner.cs
- FixedSOMGroup.cs
- Util.cs
- LineSegment.cs
- Reference.cs
- TrackingLocation.cs
- ClaimComparer.cs
- DataObjectAttribute.cs
- PenThreadWorker.cs
- NumberSubstitution.cs
- sortedlist.cs