Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- FrugalMap.cs
- ExpressionConverter.cs
- RegexWriter.cs
- CreateParams.cs
- ComboBoxItem.cs
- ParenthesizePropertyNameAttribute.cs
- BehaviorEditorPart.cs
- ConvertersCollection.cs
- Tag.cs
- DataSourceSelectArguments.cs
- ToolStripItemTextRenderEventArgs.cs
- DrawingVisual.cs
- TaskFactory.cs
- ListSourceHelper.cs
- GregorianCalendar.cs
- DataGridViewRowsRemovedEventArgs.cs
- ScriptServiceAttribute.cs
- DuplexChannel.cs
- SiteMapDataSource.cs
- LayoutUtils.cs
- EmptyEnumerator.cs
- StructuralType.cs
- TraceContextEventArgs.cs
- Int16Storage.cs
- SafeEventLogWriteHandle.cs
- ParserStreamGeometryContext.cs
- StylusEditingBehavior.cs
- Validator.cs
- DesignerResources.cs
- complextypematerializer.cs
- SHA512Managed.cs
- GroupedContextMenuStrip.cs
- XMLUtil.cs
- BufferedGraphicsContext.cs
- StructuredTypeEmitter.cs
- WindowsComboBox.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- CollectionBase.cs
- IfAction.cs
- DecimalAnimation.cs
- HitTestWithPointDrawingContextWalker.cs
- ExitEventArgs.cs
- Configuration.cs
- PlatformNotSupportedException.cs
- TextMessageEncoder.cs
- FileRecordSequenceCompletedAsyncResult.cs
- TextReturnReader.cs
- Cloud.cs
- ProfileGroupSettingsCollection.cs
- CompilerScopeManager.cs
- SpotLight.cs
- SQLInt32Storage.cs
- ConstNode.cs
- RuntimeHandles.cs
- AgileSafeNativeMemoryHandle.cs
- RenameRuleObjectDialog.cs
- RegexRunnerFactory.cs
- IdnElement.cs
- PromptStyle.cs
- MediaTimeline.cs
- ProjectionAnalyzer.cs
- DecimalStorage.cs
- ViewStateModeByIdAttribute.cs
- EventManager.cs
- Int32AnimationBase.cs
- EncryptedPackage.cs
- SqlCharStream.cs
- Binding.cs
- ObjectListFieldsPage.cs
- Query.cs
- ResourceKey.cs
- ReadContentAsBinaryHelper.cs
- MemberRelationshipService.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- AssemblySettingAttributes.cs
- ProtectedConfigurationSection.cs
- WindowsGrip.cs
- _Events.cs
- BinaryParser.cs
- TreeNodeCollection.cs
- StylusPointDescription.cs
- BitmapEditor.cs
- TypeValidationEventArgs.cs
- Vector3D.cs
- DataGridParentRows.cs
- DockPanel.cs
- HttpChannelListener.cs
- Missing.cs
- TypeReference.cs
- DropDownList.cs
- Helper.cs
- SystemTcpConnection.cs
- ExpressionLexer.cs
- DesignerCategoryAttribute.cs
- Stack.cs
- SoapCodeExporter.cs
- TextureBrush.cs
- CodeAttributeArgumentCollection.cs
- SafeSecurityHandles.cs
- RadioButtonAutomationPeer.cs