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
- CatalogZoneBase.cs
- ServerType.cs
- XAMLParseException.cs
- BindingSource.cs
- __ComObject.cs
- QueryOptionExpression.cs
- WmlImageAdapter.cs
- SqlException.cs
- RestrictedTransactionalPackage.cs
- DocumentEventArgs.cs
- WebConvert.cs
- MetadataExchangeBindings.cs
- FixedSOMGroup.cs
- SpecialNameAttribute.cs
- InstallerTypeAttribute.cs
- SafeRightsManagementQueryHandle.cs
- PropertyDescriptorComparer.cs
- StreamInfo.cs
- StaticTextPointer.cs
- SqlTypeConverter.cs
- SpeechRecognizer.cs
- MediaElementAutomationPeer.cs
- StringDictionaryEditor.cs
- ProfileService.cs
- WebPartCatalogAddVerb.cs
- DataGridViewColumnCollection.cs
- DetailsViewInsertedEventArgs.cs
- ScriptDescriptor.cs
- PolicyManager.cs
- ArcSegment.cs
- FastPropertyAccessor.cs
- PasswordValidationException.cs
- BlockUIContainer.cs
- NavigationPropertyEmitter.cs
- WindowsMenu.cs
- HitTestParameters3D.cs
- MergeFilterQuery.cs
- StrokeNodeEnumerator.cs
- DiagnosticsConfiguration.cs
- EditorZoneDesigner.cs
- CollectionContainer.cs
- DataControlFieldCell.cs
- WorkflowMarkupElementEventArgs.cs
- Currency.cs
- DiagnosticsConfigurationHandler.cs
- WebPartEventArgs.cs
- SamlAudienceRestrictionCondition.cs
- Operator.cs
- Literal.cs
- CommandDevice.cs
- AffineTransform3D.cs
- TextParagraphView.cs
- SQLCharsStorage.cs
- KeyPressEvent.cs
- XmlSerializer.cs
- TextEndOfSegment.cs
- ScriptManager.cs
- XsltLibrary.cs
- DateTimeFormat.cs
- TransformDescriptor.cs
- KeyFrames.cs
- CursorInteropHelper.cs
- MexServiceChannelBuilder.cs
- TransformerInfo.cs
- ToolboxItemAttribute.cs
- MetadataAssemblyHelper.cs
- ToggleProviderWrapper.cs
- XmlArrayAttribute.cs
- SynchronizingStream.cs
- XamlInterfaces.cs
- ListViewUpdatedEventArgs.cs
- Rect3D.cs
- ThrowHelper.cs
- ZeroOpNode.cs
- BindingCompleteEventArgs.cs
- XmlSerializer.cs
- PropertyConverter.cs
- ConfigurationValidatorBase.cs
- CurrencyWrapper.cs
- SQLInt32.cs
- SerializerWriterEventHandlers.cs
- CreatingCookieEventArgs.cs
- LogSwitch.cs
- HostedAspNetEnvironment.cs
- EmbeddedMailObjectsCollection.cs
- SqlUdtInfo.cs
- HttpCacheParams.cs
- documentsequencetextcontainer.cs
- SystemException.cs
- SchemaHelper.cs
- TypeCollectionDesigner.xaml.cs
- CodeAssignStatement.cs
- ScriptIgnoreAttribute.cs
- TextReturnReader.cs
- PropertyNames.cs
- OracleDataReader.cs
- XmlEntityReference.cs
- QuaternionAnimationBase.cs
- ReferencedType.cs
- CompositeScriptReferenceEventArgs.cs