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
- FormViewUpdateEventArgs.cs
- TextElementCollection.cs
- EncoderNLS.cs
- XhtmlTextWriter.cs
- MetadataSection.cs
- SecuritySessionServerSettings.cs
- StoragePropertyMapping.cs
- BamlBinaryReader.cs
- SafeFileMappingHandle.cs
- SqlDependency.cs
- EntityDataSourceContainerNameConverter.cs
- UpdatePanelControlTrigger.cs
- VisualTarget.cs
- TdsEnums.cs
- SettingsPropertyValueCollection.cs
- WebException.cs
- ScriptReferenceEventArgs.cs
- GenerateScriptTypeAttribute.cs
- XmlElement.cs
- ConstraintEnumerator.cs
- UnmanagedMarshal.cs
- ActivityExecutorOperation.cs
- Mapping.cs
- _ListenerResponseStream.cs
- WebBrowserDesigner.cs
- EmptyReadOnlyDictionaryInternal.cs
- DataGridRelationshipRow.cs
- WindowsGraphicsWrapper.cs
- BaseComponentEditor.cs
- ButtonFlatAdapter.cs
- SystemIPInterfaceProperties.cs
- ChildTable.cs
- ClaimTypes.cs
- DbCommandDefinition.cs
- InputScopeConverter.cs
- ResourceContainer.cs
- HopperCache.cs
- Variable.cs
- HierarchicalDataSourceDesigner.cs
- AutomationIdentifierGuids.cs
- LightweightEntityWrapper.cs
- ScopeCollection.cs
- WsdlInspector.cs
- RefExpr.cs
- SoundPlayerAction.cs
- FormViewUpdateEventArgs.cs
- LoginAutoFormat.cs
- IgnoreSectionHandler.cs
- DataGridRowEventArgs.cs
- XpsS0ValidatingLoader.cs
- Cursors.cs
- BaseParser.cs
- GAC.cs
- ComponentCache.cs
- Label.cs
- Missing.cs
- MimeMapping.cs
- MetadataCacheItem.cs
- TextPointer.cs
- DefaultParameterValueAttribute.cs
- FolderBrowserDialog.cs
- ModelItemKeyValuePair.cs
- RequestDescription.cs
- WindowsButton.cs
- listitem.cs
- ToolStripDropDownClosedEventArgs.cs
- EntityDataSource.cs
- RC2.cs
- MissingMethodException.cs
- HWStack.cs
- ClientConfigurationHost.cs
- CatalogZone.cs
- AppliedDeviceFiltersDialog.cs
- Mapping.cs
- InputReportEventArgs.cs
- IndexOutOfRangeException.cs
- DbExpressionRules.cs
- OverlappedContext.cs
- ArrayList.cs
- Properties.cs
- SQLBoolean.cs
- Pts.cs
- RecordsAffectedEventArgs.cs
- SerializationHelper.cs
- EntityKey.cs
- IsolatedStorage.cs
- ToolBar.cs
- SrgsGrammar.cs
- OdbcConnectionFactory.cs
- ChooseAction.cs
- StrokeNode.cs
- GraphicsContext.cs
- StickyNoteAnnotations.cs
- regiisutil.cs
- OrElse.cs
- SerializationInfo.cs
- IntranetCredentialPolicy.cs
- ActivityStateQuery.cs
- AssociationType.cs
- AppDomain.cs