Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- EventLogPermissionEntryCollection.cs
- ScriptReference.cs
- WizardForm.cs
- ParseNumbers.cs
- SqlCacheDependencySection.cs
- MethodImplAttribute.cs
- AmbientValueAttribute.cs
- Dynamic.cs
- StandardOleMarshalObject.cs
- PlatformCulture.cs
- ApplicationFileCodeDomTreeGenerator.cs
- XhtmlTextWriter.cs
- EntityModelSchemaGenerator.cs
- EncryptedXml.cs
- _NetRes.cs
- DPTypeDescriptorContext.cs
- ColorConverter.cs
- XmlSchemaChoice.cs
- TemplatePropertyEntry.cs
- XamlTemplateSerializer.cs
- EntitySqlQueryCacheEntry.cs
- DeflateStream.cs
- TextSelectionProcessor.cs
- TransformPatternIdentifiers.cs
- SettingsSection.cs
- SqlUtil.cs
- EdmPropertyAttribute.cs
- BamlTreeMap.cs
- COSERVERINFO.cs
- SchemaElementDecl.cs
- TaskFormBase.cs
- Int32CollectionValueSerializer.cs
- SQLBytes.cs
- SqlUDTStorage.cs
- ToolStripCustomTypeDescriptor.cs
- MetaType.cs
- ReadOnlyDictionary.cs
- CardSpacePolicyElement.cs
- PrePrepareMethodAttribute.cs
- IgnoreFileBuildProvider.cs
- DataPointer.cs
- PolicyManager.cs
- ConnectionInterfaceCollection.cs
- CodeSubDirectory.cs
- SqlGatherProducedAliases.cs
- JournalEntryStack.cs
- TypeConvertions.cs
- ReadOnlyDictionary.cs
- DataGridState.cs
- DataKey.cs
- OleStrCAMarshaler.cs
- EventListener.cs
- Mutex.cs
- SoapEnumAttribute.cs
- CaseInsensitiveHashCodeProvider.cs
- SortAction.cs
- XmlObjectSerializerWriteContextComplex.cs
- BaseParagraph.cs
- ObjectManager.cs
- DataFormat.cs
- XmlSchemaSimpleType.cs
- ErrorWrapper.cs
- ProjectionPathBuilder.cs
- NonClientArea.cs
- Polygon.cs
- CacheRequest.cs
- XmlText.cs
- UrlMappingsModule.cs
- RightsManagementEncryptedStream.cs
- updatecommandorderer.cs
- NominalTypeEliminator.cs
- FileLevelControlBuilderAttribute.cs
- ipaddressinformationcollection.cs
- SpanIndex.cs
- SqlCacheDependencyDatabaseCollection.cs
- Directory.cs
- ExitEventArgs.cs
- XmlTextWriter.cs
- TableFieldsEditor.cs
- DataObjectPastingEventArgs.cs
- TextRenderer.cs
- SchemaHelper.cs
- ZipIOExtraFieldPaddingElement.cs
- _SpnDictionary.cs
- RegexReplacement.cs
- SqlClientMetaDataCollectionNames.cs
- PartManifestEntry.cs
- TraceSection.cs
- ResXResourceWriter.cs
- PropertyGeneratedEventArgs.cs
- XmlNavigatorStack.cs
- TemplateBindingExtensionConverter.cs
- FixedSOMLineCollection.cs
- ReadOnlyDictionary.cs
- LifetimeMonitor.cs
- BadImageFormatException.cs
- CookielessData.cs
- TypeDescriptorFilterService.cs
- MouseEvent.cs
- ValidateNames.cs