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
- GeometryModel3D.cs
- SafeViewOfFileHandle.cs
- DictionaryContent.cs
- FormParameter.cs
- COM2IPerPropertyBrowsingHandler.cs
- FrameworkTextComposition.cs
- MessageRpc.cs
- SimpleType.cs
- SqlFunctionAttribute.cs
- SafeEventLogReadHandle.cs
- HMACMD5.cs
- UnmanagedMarshal.cs
- ScrollChangedEventArgs.cs
- OutOfMemoryException.cs
- TraceInternal.cs
- NavigationPropertyEmitter.cs
- OutOfProcStateClientManager.cs
- DesignerAdapterAttribute.cs
- OleDbParameter.cs
- ComplexLine.cs
- ControlParameter.cs
- DriveInfo.cs
- AvtEvent.cs
- SyndicationSerializer.cs
- RuntimeHelpers.cs
- DiscreteKeyFrames.cs
- ManagementOperationWatcher.cs
- DoubleUtil.cs
- CodeMemberEvent.cs
- Size3DConverter.cs
- ErrorHandler.cs
- FileLogRecord.cs
- XMLSchema.cs
- EntityCommandDefinition.cs
- ToolZoneDesigner.cs
- WebBrowserProgressChangedEventHandler.cs
- ObjectAnimationUsingKeyFrames.cs
- RegularExpressionValidator.cs
- AuthorizationRuleCollection.cs
- BinarySerializer.cs
- Debug.cs
- EDesignUtil.cs
- HtmlTableCellCollection.cs
- KoreanCalendar.cs
- DiscoveryEndpoint.cs
- SiteMapNodeItem.cs
- InstanceKeyView.cs
- WindowsStatusBar.cs
- autovalidator.cs
- LinqDataSourceUpdateEventArgs.cs
- AuthenticationModulesSection.cs
- ScrollItemProviderWrapper.cs
- TreeNodeBindingCollection.cs
- DescendantQuery.cs
- cache.cs
- ResourceType.cs
- X509ChainPolicy.cs
- VirtualPath.cs
- PerfCounters.cs
- NestedContainer.cs
- WsdlBuildProvider.cs
- FactoryMaker.cs
- DataConnectionHelper.cs
- RuleEngine.cs
- initElementDictionary.cs
- RawStylusActions.cs
- XPathNodeList.cs
- SchemaTypeEmitter.cs
- EmptyStringExpandableObjectConverter.cs
- CodeSnippetTypeMember.cs
- OracleNumber.cs
- NetStream.cs
- InspectionWorker.cs
- EventMap.cs
- WindowsFormsSectionHandler.cs
- DataListItemCollection.cs
- ObjectStateFormatter.cs
- messageonlyhwndwrapper.cs
- CounterCreationDataConverter.cs
- SchemaHelper.cs
- ProxyWebPartConnectionCollection.cs
- AlphabetConverter.cs
- CryptoConfig.cs
- RegionInfo.cs
- IsolatedStorageFileStream.cs
- PeerTransportElement.cs
- UnsafeNativeMethods.cs
- FirewallWrapper.cs
- MatrixStack.cs
- XmlElementAttribute.cs
- ButtonField.cs
- PointIndependentAnimationStorage.cs
- Barrier.cs
- TdsParameterSetter.cs
- SpellerHighlightLayer.cs
- TextEditorParagraphs.cs
- NavigationFailedEventArgs.cs
- DNS.cs
- SimpleBitVector32.cs
- CollectionBuilder.cs