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
- ListViewItem.cs
- KeyGesture.cs
- XPathNode.cs
- DataSourceControl.cs
- JoinElimination.cs
- FilterElement.cs
- BuildManagerHost.cs
- SafeViewOfFileHandle.cs
- SerializationObjectManager.cs
- PersonalizationProviderHelper.cs
- FontDialog.cs
- DesignerTransaction.cs
- HttpWebRequestElement.cs
- BufferAllocator.cs
- ConfigXmlText.cs
- ObjectStorage.cs
- DSASignatureDeformatter.cs
- BindingWorker.cs
- WindowsSidIdentity.cs
- HwndSubclass.cs
- CodeCompileUnit.cs
- InternalConfigSettingsFactory.cs
- ColumnTypeConverter.cs
- PropertyGrid.cs
- SafeNativeMethods.cs
- CodeIdentifier.cs
- Int32Converter.cs
- XmlSchemaChoice.cs
- WindowsFormsSectionHandler.cs
- SearchExpression.cs
- NativeMethods.cs
- ProfileParameter.cs
- ProviderIncompatibleException.cs
- WinFormsComponentEditor.cs
- XmlArrayItemAttribute.cs
- KeySpline.cs
- BaseHashHelper.cs
- CreateParams.cs
- printdlgexmarshaler.cs
- WebPartsSection.cs
- DurableRuntimeValidator.cs
- ContextQuery.cs
- HttpProfileBase.cs
- Cursor.cs
- UrlPath.cs
- EntityDataSourceWrapperCollection.cs
- ContentOperations.cs
- ICspAsymmetricAlgorithm.cs
- SymmetricSecurityProtocol.cs
- DummyDataSource.cs
- ParallelTimeline.cs
- UndirectedGraph.cs
- UserControl.cs
- DataFieldEditor.cs
- EntityRecordInfo.cs
- SerializationInfoEnumerator.cs
- ProgressiveCrcCalculatingStream.cs
- SmiMetaData.cs
- SelectionEditor.cs
- DoubleCollectionValueSerializer.cs
- Validator.cs
- DPAPIProtectedConfigurationProvider.cs
- XPathNodePointer.cs
- StatusBarAutomationPeer.cs
- StandardToolWindows.cs
- ToolStripSplitButton.cs
- InheritanceContextHelper.cs
- RadialGradientBrush.cs
- UriTemplatePathSegment.cs
- EventHandlerList.cs
- SqlLiftWhereClauses.cs
- Timer.cs
- IgnorePropertiesAttribute.cs
- CodeAssignStatement.cs
- AnimationStorage.cs
- UnmanagedMemoryStreamWrapper.cs
- _AcceptOverlappedAsyncResult.cs
- _IPv4Address.cs
- SvcMapFile.cs
- ParameterSubsegment.cs
- DbParameterCollectionHelper.cs
- StoryFragments.cs
- XmlDataDocument.cs
- Dispatcher.cs
- DecoderReplacementFallback.cs
- MailMessage.cs
- BasicCellRelation.cs
- SelectionRangeConverter.cs
- ScrollChrome.cs
- TTSEngineProxy.cs
- SqlDelegatedTransaction.cs
- EmptyReadOnlyDictionaryInternal.cs
- ProviderCollection.cs
- ListenerChannelContext.cs
- TimeoutException.cs
- Invariant.cs
- EventProxy.cs
- ConnectionProviderAttribute.cs
- XmlKeywords.cs
- NamedPipeWorkerProcess.cs