Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ReadOnlyDictionary.cs
- SerialReceived.cs
- AdCreatedEventArgs.cs
- HandleDictionary.cs
- XmlHierarchicalDataSourceView.cs
- ContainerControlDesigner.cs
- XmlDocumentType.cs
- iisPickupDirectory.cs
- ScaleTransform.cs
- FastEncoder.cs
- TypeDescriptionProvider.cs
- MappedMetaModel.cs
- RenderData.cs
- ConnectionsZone.cs
- SafeRightsManagementEnvironmentHandle.cs
- ListViewGroupItemCollection.cs
- StatusStrip.cs
- EtwTrackingBehavior.cs
- DecoderExceptionFallback.cs
- CodeTypeDelegate.cs
- InvalidDataException.cs
- DragDrop.cs
- ChannelEndpointElementCollection.cs
- NewItemsContextMenuStrip.cs
- PersistChildrenAttribute.cs
- SecurityTokenResolver.cs
- RelationshipConverter.cs
- ExtendedPropertyDescriptor.cs
- CustomErrorsSectionWrapper.cs
- DesignerUtility.cs
- NativeStructs.cs
- EventLogEntry.cs
- CharKeyFrameCollection.cs
- RegexWorker.cs
- TypeLoadException.cs
- CollectionEditorDialog.cs
- ObjectStateFormatter.cs
- StreamingContext.cs
- RegistryKey.cs
- IsolatedStorage.cs
- FunctionParameter.cs
- EntityDataSource.cs
- StrokeNodeData.cs
- CatalogPartCollection.cs
- ObjectItemCollection.cs
- DesignerSerializationVisibilityAttribute.cs
- DtrList.cs
- ToolBarOverflowPanel.cs
- coordinatorscratchpad.cs
- SiteMembershipCondition.cs
- ObjectToken.cs
- BypassElement.cs
- _TimerThread.cs
- elementinformation.cs
- UrlPath.cs
- DataGridLinkButton.cs
- ResourceContainer.cs
- OperationPickerDialog.cs
- EventSchemaTraceListener.cs
- DetailsViewModeEventArgs.cs
- DocumentReferenceCollection.cs
- BindingCollection.cs
- InstancePersistenceCommand.cs
- JsonReader.cs
- CodeAttributeDeclaration.cs
- safemediahandle.cs
- ListControlDesigner.cs
- PenThreadPool.cs
- OrderablePartitioner.cs
- EventDriven.cs
- DependencyObject.cs
- OdbcConnectionString.cs
- XmlWriterSettings.cs
- XmlSchemaType.cs
- FormClosingEvent.cs
- OrderByQueryOptionExpression.cs
- ObjectSecurity.cs
- TextCollapsingProperties.cs
- PropertyEmitter.cs
- TabItemWrapperAutomationPeer.cs
- Select.cs
- Stack.cs
- AppDomainGrammarProxy.cs
- RtType.cs
- CharacterHit.cs
- LayoutInformation.cs
- Atom10FeedFormatter.cs
- WebResourceUtil.cs
- SiteMapSection.cs
- DesignerSerializerAttribute.cs
- XmlText.cs
- SystemException.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- IDispatchConstantAttribute.cs
- PasswordTextContainer.cs
- XmlIterators.cs
- UTF7Encoding.cs
- SectionXmlInfo.cs
- UnsafeNativeMethods.cs
- TagPrefixCollection.cs