Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathArrayIterator.cs / 2 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ConfigurationManagerInternal.cs
- TabControl.cs
- FontFaceLayoutInfo.cs
- EventArgs.cs
- DataServiceRequestOfT.cs
- Vector3DCollectionConverter.cs
- RegexCode.cs
- ToolStripOverflow.cs
- SqlMetaData.cs
- OrderToken.cs
- MemoryMappedViewAccessor.cs
- ExpiredSecurityTokenException.cs
- ItemChangedEventArgs.cs
- PageCatalogPart.cs
- SourceLocation.cs
- EntityProviderFactory.cs
- ModulesEntry.cs
- LoadedOrUnloadedOperation.cs
- ListBoxAutomationPeer.cs
- WorkflowApplicationUnloadedException.cs
- StackOverflowException.cs
- WMIGenerator.cs
- EventLogEntry.cs
- BoundsDrawingContextWalker.cs
- FileInfo.cs
- ValidatedControlConverter.cs
- MetadataItemEmitter.cs
- XsltContext.cs
- XamlReader.cs
- ADMembershipUser.cs
- HandledMouseEvent.cs
- SID.cs
- AutomationProperties.cs
- AnonymousIdentificationSection.cs
- CommandLineParser.cs
- Condition.cs
- ByteStream.cs
- ShaperBuffers.cs
- DbMetaDataColumnNames.cs
- EntityPropertyMappingAttribute.cs
- SqlRetyper.cs
- ScrollChrome.cs
- SubMenuStyle.cs
- PerformanceCounterPermission.cs
- XamlTreeBuilder.cs
- CacheForPrimitiveTypes.cs
- PageAsyncTaskManager.cs
- CodeTypeDeclaration.cs
- ConnectionConsumerAttribute.cs
- SafeFileHandle.cs
- EpmContentSerializerBase.cs
- HotSpotCollection.cs
- FullTrustAssembliesSection.cs
- KeyValueSerializer.cs
- ToolStripItemClickedEventArgs.cs
- CryptoConfig.cs
- FontCollection.cs
- ButtonColumn.cs
- XmlEncoding.cs
- EntityDataSourceContainerNameConverter.cs
- SubclassTypeValidatorAttribute.cs
- AnnotationAuthorChangedEventArgs.cs
- SQLInt16.cs
- Command.cs
- TraceContext.cs
- CopyNamespacesAction.cs
- WindowsSlider.cs
- WebEvents.cs
- RegexCharClass.cs
- HotSpotCollection.cs
- PolyBezierSegmentFigureLogic.cs
- SqlGatherConsumedAliases.cs
- remotingproxy.cs
- HierarchicalDataSourceControl.cs
- TypeSource.cs
- DataGridComboBoxColumn.cs
- SoapSchemaExporter.cs
- RowUpdatingEventArgs.cs
- StateChangeEvent.cs
- ConstraintStruct.cs
- PasswordTextNavigator.cs
- ServiceCredentialsSecurityTokenManager.cs
- AutomationProperties.cs
- ECDsa.cs
- SqlMethodTransformer.cs
- DBBindings.cs
- ConfigXmlText.cs
- ImageFormat.cs
- UIEndRequest.cs
- OrderedEnumerableRowCollection.cs
- BaseServiceProvider.cs
- DynamicRendererThreadManager.cs
- RequestQueue.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- activationcontext.cs
- CreateUserWizard.cs
- XmlWrappingWriter.cs
- StorageFunctionMapping.cs
- DataServiceStreamResponse.cs
- DrawingContextWalker.cs