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
- QilFactory.cs
- SpecularMaterial.cs
- HtmlInputHidden.cs
- ConfigurationException.cs
- RegionInfo.cs
- NetSectionGroup.cs
- ReflectPropertyDescriptor.cs
- SrgsDocumentParser.cs
- StylusPointProperties.cs
- KeyToListMap.cs
- GridItemPatternIdentifiers.cs
- TreeView.cs
- EdmProviderManifest.cs
- BreakRecordTable.cs
- ReferentialConstraint.cs
- SelectingProviderEventArgs.cs
- TouchesCapturedWithinProperty.cs
- MailAddressCollection.cs
- TableCell.cs
- ISCIIEncoding.cs
- Vars.cs
- HybridDictionary.cs
- SerializableAuthorizationContext.cs
- Relationship.cs
- ToolStripOverflow.cs
- LostFocusEventManager.cs
- DataServiceContext.cs
- PolicyLevel.cs
- CorrelationResolver.cs
- Hex.cs
- DataSourceIDConverter.cs
- ImageFormat.cs
- RuntimeHandles.cs
- BlurBitmapEffect.cs
- ForEachAction.cs
- DataControlField.cs
- MessageProtectionOrder.cs
- ShaderEffect.cs
- SoapExtensionTypeElementCollection.cs
- Empty.cs
- MachineKey.cs
- DefaultBinder.cs
- CollectionTraceRecord.cs
- ErrorLog.cs
- SQLGuid.cs
- QilXmlReader.cs
- OrderByBuilder.cs
- EdmRelationshipRoleAttribute.cs
- ListBindableAttribute.cs
- SqlDataSourceConnectionPanel.cs
- MimeBasePart.cs
- XmlAttribute.cs
- XPathParser.cs
- StringWriter.cs
- PersonalizablePropertyEntry.cs
- WebControlToolBoxItem.cs
- ControlParameter.cs
- FormatSettings.cs
- AssemblyCache.cs
- GatewayDefinition.cs
- DataViewSettingCollection.cs
- MimeObjectFactory.cs
- TreePrinter.cs
- FilterableAttribute.cs
- ModuleBuilder.cs
- BrowserCapabilitiesFactory.cs
- DataFormats.cs
- WindowsComboBox.cs
- ConditionalDesigner.cs
- Int64AnimationUsingKeyFrames.cs
- MatrixTransform.cs
- PageParserFilter.cs
- MDIClient.cs
- regiisutil.cs
- ImmutableAssemblyCacheEntry.cs
- XmlCompatibilityReader.cs
- XmlnsDictionary.cs
- LinearGradientBrush.cs
- IxmlLineInfo.cs
- VerificationAttribute.cs
- NavigatorInput.cs
- TextSelectionHighlightLayer.cs
- VSWCFServiceContractGenerator.cs
- ResourcesBuildProvider.cs
- OperandQuery.cs
- EventDescriptor.cs
- _LazyAsyncResult.cs
- SpanIndex.cs
- SinglePhaseEnlistment.cs
- ArcSegment.cs
- EntityDataSourceUtil.cs
- TableRowGroupCollection.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- FilterElement.cs
- EntityCodeGenerator.cs
- COM2ColorConverter.cs
- InplaceBitmapMetadataWriter.cs
- AssemblyBuilderData.cs
- XslUrlEditor.cs
- WindowAutomationPeer.cs