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
- WebDescriptionAttribute.cs
- BitmapMetadataEnumerator.cs
- Knowncolors.cs
- Empty.cs
- QilPatternVisitor.cs
- TextSchema.cs
- RuleElement.cs
- BitmapEffectInput.cs
- FilterableAttribute.cs
- Transform3DCollection.cs
- StrokeIntersection.cs
- LinqDataSourceDeleteEventArgs.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- ApplicationServiceHelper.cs
- UIHelper.cs
- PropertyGrid.cs
- ScrollableControl.cs
- KeyConstraint.cs
- QueryableDataSourceHelper.cs
- SqlSupersetValidator.cs
- SafeProcessHandle.cs
- UrlPath.cs
- SelectionListComponentEditor.cs
- PromptEventArgs.cs
- TextParagraphProperties.cs
- SEHException.cs
- CommandField.cs
- RegexBoyerMoore.cs
- Operators.cs
- SecurityHelper.cs
- XmlChildEnumerator.cs
- WebServiceClientProxyGenerator.cs
- SynchronizationLockException.cs
- VisualBasic.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- WindowsFormsSectionHandler.cs
- SQLDateTime.cs
- AnimatedTypeHelpers.cs
- AuthorizationSection.cs
- ResourceDisplayNameAttribute.cs
- ReferenceService.cs
- PolyLineSegmentFigureLogic.cs
- ToolStripSplitStackLayout.cs
- StylusOverProperty.cs
- XmlAnyAttributeAttribute.cs
- ProxyWebPart.cs
- X500Name.cs
- PageParserFilter.cs
- XmlSchemaSequence.cs
- ActiveXHelper.cs
- MenuCommand.cs
- FormsIdentity.cs
- ConstantExpression.cs
- StringConverter.cs
- Attachment.cs
- PeerNameRegistration.cs
- DisplayInformation.cs
- TableAdapterManagerMethodGenerator.cs
- ObjectDisposedException.cs
- ChoiceConverter.cs
- PageThemeBuildProvider.cs
- EmptyImpersonationContext.cs
- HashHelper.cs
- SmtpReplyReaderFactory.cs
- AssemblyAttributes.cs
- DateTimeUtil.cs
- XamlPathDataSerializer.cs
- Focus.cs
- AnimationTimeline.cs
- DefaultPropertyAttribute.cs
- IOThreadTimer.cs
- ContainerFilterService.cs
- StringValueSerializer.cs
- CodeSnippetCompileUnit.cs
- EntityDataSourceReferenceGroup.cs
- ByteKeyFrameCollection.cs
- CodeTypeReferenceExpression.cs
- ContentPlaceHolder.cs
- StrokeIntersection.cs
- XmlTypeAttribute.cs
- TreeNodeMouseHoverEvent.cs
- Metafile.cs
- Context.cs
- StringHandle.cs
- GraphicsPathIterator.cs
- ObsoleteAttribute.cs
- CompositeKey.cs
- ProfileServiceManager.cs
- StorageMappingItemCollection.cs
- LocatorGroup.cs
- SymbolPair.cs
- PopupControlService.cs
- ImageListUtils.cs
- _LocalDataStoreMgr.cs
- COMException.cs
- Item.cs
- diagnosticsswitches.cs
- ConnectionModeReader.cs
- DataGridViewControlCollection.cs
- SolidBrush.cs