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
- SizeF.cs
- TemplateControlBuildProvider.cs
- ZipPackagePart.cs
- ProofTokenCryptoHandle.cs
- DispatcherExceptionFilterEventArgs.cs
- rsa.cs
- TextServicesPropertyRanges.cs
- Util.cs
- FakeModelItemImpl.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- UIElement3D.cs
- CodeTryCatchFinallyStatement.cs
- MenuCommand.cs
- ReflectionPermission.cs
- HTMLTextWriter.cs
- ArrayConverter.cs
- TextBox.cs
- SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs
- Classification.cs
- XmlNodeComparer.cs
- MailMessageEventArgs.cs
- PreservationFileWriter.cs
- BulletDecorator.cs
- DirectionalLight.cs
- KeyValueInternalCollection.cs
- DataServiceHost.cs
- xdrvalidator.cs
- IDispatchConstantAttribute.cs
- EntitySqlQueryCacheEntry.cs
- TCEAdapterGenerator.cs
- GroupItem.cs
- WorkflowMessageEventHandler.cs
- ContentFilePart.cs
- TypeUsageBuilder.cs
- AdornerPresentationContext.cs
- InvokeMethodDesigner.xaml.cs
- ThreadExceptionDialog.cs
- ContextMenuStrip.cs
- SafeRightsManagementHandle.cs
- TraceSwitch.cs
- ConfigXmlWhitespace.cs
- RegisteredExpandoAttribute.cs
- IisTraceWebEventProvider.cs
- FreeFormDragDropManager.cs
- Column.cs
- smtppermission.cs
- EncoderParameters.cs
- MessageQueueKey.cs
- AuthenticationException.cs
- WebBrowserNavigatedEventHandler.cs
- TemplateComponentConnector.cs
- SecUtil.cs
- HtmlImageAdapter.cs
- CheckBoxAutomationPeer.cs
- WindowsListViewSubItem.cs
- xdrvalidator.cs
- CollectionChangeEventArgs.cs
- AuthenticationSection.cs
- HostingEnvironmentSection.cs
- NetCodeGroup.cs
- GeometryGroup.cs
- NamespaceExpr.cs
- TextStore.cs
- ColumnMap.cs
- StorageEntityContainerMapping.cs
- ValueType.cs
- SetIterators.cs
- XslNumber.cs
- AssociationTypeEmitter.cs
- NativeRecognizer.cs
- ToolStripDropDownClosingEventArgs.cs
- QueryCacheManager.cs
- Size3DValueSerializer.cs
- util.cs
- XmlC14NWriter.cs
- BooleanExpr.cs
- CodeTypeMemberCollection.cs
- NodeFunctions.cs
- basenumberconverter.cs
- PerspectiveCamera.cs
- Metadata.cs
- SchemaObjectWriter.cs
- TransformDescriptor.cs
- RubberbandSelector.cs
- DetectEofStream.cs
- HealthMonitoringSection.cs
- IDispatchConstantAttribute.cs
- TranslateTransform3D.cs
- CancelEventArgs.cs
- DeclaredTypeValidator.cs
- ProtocolsConfigurationHandler.cs
- ApplicationProxyInternal.cs
- FontClient.cs
- BuildProviderUtils.cs
- CultureInfoConverter.cs
- EngineSiteSapi.cs
- BindingBase.cs
- ColorTranslator.cs
- DataViewManagerListItemTypeDescriptor.cs
- ValidationErrorCollection.cs