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
- unsafenativemethodstextservices.cs
- OracleBoolean.cs
- ClaimTypes.cs
- ObfuscationAttribute.cs
- NativeMethods.cs
- CalendarTable.cs
- Regex.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- XmlBaseReader.cs
- AstNode.cs
- URLAttribute.cs
- CultureInfoConverter.cs
- ApplicationInfo.cs
- OdbcConnection.cs
- BitmapMetadata.cs
- CategoryAttribute.cs
- GZipUtils.cs
- SqlProfileProvider.cs
- _ProxyChain.cs
- MULTI_QI.cs
- CodeDelegateCreateExpression.cs
- Solver.cs
- PlainXmlSerializer.cs
- AnnouncementEventArgs.cs
- EntityClientCacheEntry.cs
- PlainXmlSerializer.cs
- Symbol.cs
- UserMapPath.cs
- CustomMenuItemCollection.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ProviderBase.cs
- CacheVirtualItemsEvent.cs
- COM2Properties.cs
- RevocationPoint.cs
- RichTextBox.cs
- streamingZipPartStream.cs
- DoubleAnimationUsingPath.cs
- StaticDataManager.cs
- AmbientLight.cs
- ConnectionPoolManager.cs
- GeneralTransform3DTo2D.cs
- base64Transforms.cs
- PageAdapter.cs
- SchemaImporterExtensionElement.cs
- ExtenderControl.cs
- SByteConverter.cs
- HttpApplicationFactory.cs
- RegisteredDisposeScript.cs
- FormViewModeEventArgs.cs
- TypeGenericEnumerableViewSchema.cs
- WrappedReader.cs
- ExpressionParser.cs
- MultipartContentParser.cs
- SystemIPv6InterfaceProperties.cs
- XmlBinaryWriter.cs
- MobileControl.cs
- Application.cs
- ClientUtils.cs
- SqlConnectionHelper.cs
- GridViewColumn.cs
- DictionarySectionHandler.cs
- ItemList.cs
- XmlUtf8RawTextWriter.cs
- BasePropertyDescriptor.cs
- ApplicationServiceHelper.cs
- _TransmitFileOverlappedAsyncResult.cs
- Int64Converter.cs
- EntityType.cs
- EncoderParameters.cs
- SoapAttributes.cs
- WasAdminWrapper.cs
- SHA256Managed.cs
- SimpleType.cs
- PasswordBox.cs
- TemplatedMailWebEventProvider.cs
- TableRow.cs
- UpdateException.cs
- InvalidCastException.cs
- IApplicationTrustManager.cs
- Int64KeyFrameCollection.cs
- ColumnPropertiesGroup.cs
- ListViewItemMouseHoverEvent.cs
- PageThemeParser.cs
- InfoCardBaseException.cs
- FixedPageAutomationPeer.cs
- GridViewRowCollection.cs
- DefaultShape.cs
- WindowsGraphicsCacheManager.cs
- ElementsClipboardData.cs
- Duration.cs
- SspiHelper.cs
- IIS7UserPrincipal.cs
- WebExceptionStatus.cs
- LambdaCompiler.Binary.cs
- Window.cs
- QilNode.cs
- OdbcError.cs
- SHA1CryptoServiceProvider.cs
- DirectoryNotFoundException.cs
- ResourceReferenceExpression.cs