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
- XmlException.cs
- XamlSerializer.cs
- Variant.cs
- PartialList.cs
- TCEAdapterGenerator.cs
- AuthenticationModulesSection.cs
- Duration.cs
- Exceptions.cs
- UIElementHelper.cs
- MonthChangedEventArgs.cs
- DataGridViewAccessibleObject.cs
- EnumerableRowCollection.cs
- SimpleRecyclingCache.cs
- WebPartCatalogCloseVerb.cs
- PEFileReader.cs
- CommandSet.cs
- UnsafeCollabNativeMethods.cs
- AttachmentService.cs
- XmlQualifiedNameTest.cs
- DllNotFoundException.cs
- XmlNodeWriter.cs
- ProvidePropertyAttribute.cs
- MimeTextImporter.cs
- SecurityPolicySection.cs
- DocumentGrid.cs
- XmlSignificantWhitespace.cs
- DependencyPropertyKind.cs
- BitStream.cs
- HwndProxyElementProvider.cs
- MenuItem.cs
- RedBlackList.cs
- MouseEventArgs.cs
- Stopwatch.cs
- ExpressionStringBuilder.cs
- Ref.cs
- PreservationFileReader.cs
- OperationAbortedException.cs
- IdentityNotMappedException.cs
- Size3DConverter.cs
- RenamedEventArgs.cs
- ChildrenQuery.cs
- CodeParameterDeclarationExpression.cs
- sqlinternaltransaction.cs
- SeekableReadStream.cs
- DataContractSerializer.cs
- StringTraceRecord.cs
- SQLBinaryStorage.cs
- CodeParameterDeclarationExpressionCollection.cs
- TypeBrowserDialog.cs
- DirectionalLight.cs
- RadioButtonRenderer.cs
- DataSet.cs
- SettingsProperty.cs
- WebBrowserNavigatingEventHandler.cs
- DllNotFoundException.cs
- EncryptedPackageFilter.cs
- UnsafeNativeMethods.cs
- TypeUtils.cs
- ComponentSerializationService.cs
- DBParameter.cs
- ChtmlTextWriter.cs
- HeaderUtility.cs
- smtpconnection.cs
- FontUnit.cs
- Label.cs
- BuilderElements.cs
- AuthenticationException.cs
- WebBrowser.cs
- TreeViewImageKeyConverter.cs
- HttpValueCollection.cs
- ControlPropertyNameConverter.cs
- ZoneLinkButton.cs
- XmlAggregates.cs
- NativeCompoundFileAPIs.cs
- ThreadAttributes.cs
- DetailsViewPagerRow.cs
- SingleAnimationUsingKeyFrames.cs
- XmlNodeComparer.cs
- PublisherIdentityPermission.cs
- LowerCaseStringConverter.cs
- AttachmentCollection.cs
- RijndaelManaged.cs
- regiisutil.cs
- Ops.cs
- ColorAnimation.cs
- BaseCollection.cs
- DbDeleteCommandTree.cs
- ContractSearchPattern.cs
- MdImport.cs
- FrameworkContentElementAutomationPeer.cs
- Int32CollectionValueSerializer.cs
- FileLogRecordEnumerator.cs
- StaticFileHandler.cs
- SmiRequestExecutor.cs
- TransformProviderWrapper.cs
- PriorityBindingExpression.cs
- BamlStream.cs
- PathGeometry.cs
- MemoryStream.cs
- LinkLabel.cs