Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathArrayIterator.cs / 1 / XPathArrayIterator.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; using System.Collections; [DebuggerDisplay("Position={CurrentPosition}, Current={debuggerDisplayProxy, nq}")] internal class XPathArrayIterator : ResetableIterator { protected IList list; protected int index; public XPathArrayIterator(IList list) { this.list = list; } public XPathArrayIterator(XPathArrayIterator it) { this.list = it.list; this.index = it.index; } public XPathArrayIterator(XPathNodeIterator nodeIterator) { this.list = new ArrayList(); while (nodeIterator.MoveNext()) { this.list.Add(nodeIterator.Current.Clone()); } } public IList AsList { get { return this.list; } } public override XPathNodeIterator Clone() { return new XPathArrayIterator(this); } public override XPathNavigator Current { get { Debug.Assert(index <= list.Count); if (index < 1) throw new InvalidOperationException(Res.GetString(Res.Sch_EnumNotStarted, string.Empty)); return (XPathNavigator) list[index - 1]; } } public override int CurrentPosition { get { return index; } } public override int Count { get { return list.Count; } } public override bool MoveNext() { Debug.Assert(index <= list.Count); if (index == list.Count) { return false; } index++; return true; } public override void Reset() { index = 0; } public override IEnumerator GetEnumerator() { return list.GetEnumerator(); } private object debuggerDisplayProxy { get { return index < 1 ? null : (object)new XPathNavigator.DebuggerDisplayProxy(Current); } } } } // 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; using System.Collections; [DebuggerDisplay("Position={CurrentPosition}, Current={debuggerDisplayProxy, nq}")] internal class XPathArrayIterator : ResetableIterator { protected IList list; protected int index; public XPathArrayIterator(IList list) { this.list = list; } public XPathArrayIterator(XPathArrayIterator it) { this.list = it.list; this.index = it.index; } public XPathArrayIterator(XPathNodeIterator nodeIterator) { this.list = new ArrayList(); while (nodeIterator.MoveNext()) { this.list.Add(nodeIterator.Current.Clone()); } } public IList AsList { get { return this.list; } } public override XPathNodeIterator Clone() { return new XPathArrayIterator(this); } public override XPathNavigator Current { get { Debug.Assert(index <= list.Count); if (index < 1) throw new InvalidOperationException(Res.GetString(Res.Sch_EnumNotStarted, string.Empty)); return (XPathNavigator) list[index - 1]; } } public override int CurrentPosition { get { return index; } } public override int Count { get { return list.Count; } } public override bool MoveNext() { Debug.Assert(index <= list.Count); if (index == list.Count) { return false; } index++; return true; } public override void Reset() { index = 0; } public override IEnumerator GetEnumerator() { return list.GetEnumerator(); } private object debuggerDisplayProxy { get { return index < 1 ? null : (object)new XPathNavigator.DebuggerDisplayProxy(Current); } } } } // 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
- ToggleProviderWrapper.cs
- brushes.cs
- SimpleTypeResolver.cs
- DynamicDocumentPaginator.cs
- MsmqIntegrationSecurityMode.cs
- JavaScriptString.cs
- AudioFormatConverter.cs
- AlternateViewCollection.cs
- NCryptNative.cs
- RuleProcessor.cs
- HtmlProps.cs
- EntityException.cs
- WmpBitmapEncoder.cs
- CommandSet.cs
- DispatchWrapper.cs
- Int16Converter.cs
- LoginCancelEventArgs.cs
- TreeNodeMouseHoverEvent.cs
- MemoryPressure.cs
- DataControlCommands.cs
- Int16AnimationUsingKeyFrames.cs
- Utils.cs
- ClassData.cs
- CodeDomDesignerLoader.cs
- ObjectItemCollection.cs
- XhtmlBasicControlAdapter.cs
- RotateTransform.cs
- SmiContextFactory.cs
- ThemeDirectoryCompiler.cs
- Cloud.cs
- PageTrueTypeFont.cs
- ImageUrlEditor.cs
- BitmapSource.cs
- PackWebRequest.cs
- Pen.cs
- TableItemProviderWrapper.cs
- QueueNameHelper.cs
- DataGridColumn.cs
- UserPreferenceChangedEventArgs.cs
- ApplicationCommands.cs
- Clipboard.cs
- CanonicalFontFamilyReference.cs
- Marshal.cs
- StubHelpers.cs
- BitmapEffect.cs
- ChtmlImageAdapter.cs
- CommandBindingCollection.cs
- RayHitTestParameters.cs
- XmlLanguage.cs
- SettingsSavedEventArgs.cs
- XmlILAnnotation.cs
- InputLanguageEventArgs.cs
- SqlDataSourceEnumerator.cs
- CalendarDay.cs
- AppDomainCompilerProxy.cs
- ToolboxDataAttribute.cs
- ViewStateException.cs
- XmlSubtreeReader.cs
- BitmapEffectInput.cs
- MasterPageBuildProvider.cs
- BitmapEffectRenderDataResource.cs
- DataGridViewTopRowAccessibleObject.cs
- SqlDuplicator.cs
- MailBnfHelper.cs
- EntityTemplateUserControl.cs
- CompositionTarget.cs
- MetadataCollection.cs
- MgmtConfigurationRecord.cs
- Stackframe.cs
- ResourceReferenceExpressionConverter.cs
- CircleHotSpot.cs
- SoapAttributes.cs
- FixedStringLookup.cs
- DynamicPropertyHolder.cs
- OperandQuery.cs
- InfoCardRequestException.cs
- FormViewModeEventArgs.cs
- DataFormats.cs
- StorageEntityContainerMapping.cs
- SamlSerializer.cs
- ViewStateModeByIdAttribute.cs
- URLAttribute.cs
- TypeElementCollection.cs
- ToolStripScrollButton.cs
- TextOnlyOutput.cs
- OutputCacheProfileCollection.cs
- WebPartDisplayModeCollection.cs
- FlowDocumentView.cs
- ContentPosition.cs
- DecimalConstantAttribute.cs
- XmlDsigSep2000.cs
- RectangleGeometry.cs
- StandardToolWindows.cs
- SafeMILHandle.cs
- HorizontalAlignConverter.cs
- Identifier.cs
- HMACSHA256.cs
- XPathDocumentNavigator.cs
- DataGridViewCellFormattingEventArgs.cs
- SrgsSemanticInterpretationTag.cs