Code:
/ FX-1434 / FX-1434 / 1.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
- TextTreeRootNode.cs
- PreservationFileReader.cs
- Inline.cs
- GridViewPageEventArgs.cs
- FindCriteria11.cs
- BuildManagerHost.cs
- SystemNetworkInterface.cs
- TextElementCollection.cs
- SoapException.cs
- DataServiceContext.cs
- FormViewPageEventArgs.cs
- DependencyObjectType.cs
- HostedElements.cs
- UDPClient.cs
- XmlArrayItemAttribute.cs
- HttpPostProtocolReflector.cs
- entitydatasourceentitysetnameconverter.cs
- ListParagraph.cs
- StringSource.cs
- WeakReferenceEnumerator.cs
- TopClause.cs
- NodeInfo.cs
- SortedList.cs
- CultureSpecificStringDictionary.cs
- DateTimeValueSerializerContext.cs
- SamlSecurityTokenAuthenticator.cs
- ProtectedConfiguration.cs
- DesignerObject.cs
- ObjectDataSourceMethodEventArgs.cs
- MimeParameter.cs
- RemotingConfiguration.cs
- AccessibleObject.cs
- XpsResource.cs
- ProxyElement.cs
- OutputCacheModule.cs
- XmlByteStreamReader.cs
- RelatedView.cs
- ListView.cs
- CredentialCache.cs
- Misc.cs
- WebReferencesBuildProvider.cs
- MonthChangedEventArgs.cs
- UpdateCompiler.cs
- XmlSchemaParticle.cs
- BroadcastEventHelper.cs
- PartialCachingControl.cs
- XmlSchemaComplexContentExtension.cs
- NetPeerTcpBindingCollectionElement.cs
- CustomErrorCollection.cs
- ByteStreamMessageEncoder.cs
- TextTabProperties.cs
- XmlNodeChangedEventManager.cs
- EntityDataSourceDesigner.cs
- ToolStripItemEventArgs.cs
- FragmentQueryProcessor.cs
- QilUnary.cs
- xdrvalidator.cs
- FileDocument.cs
- HtmlHead.cs
- WorkflowFormatterBehavior.cs
- ToolstripProfessionalRenderer.cs
- CurrentTimeZone.cs
- MetafileHeaderWmf.cs
- ServiceDocumentFormatter.cs
- Icon.cs
- FileVersionInfo.cs
- Header.cs
- TreeNodeMouseHoverEvent.cs
- BaseProcessor.cs
- DataGridViewDataErrorEventArgs.cs
- NativeMethods.cs
- DateTimeAutomationPeer.cs
- ReflectEventDescriptor.cs
- DecoderExceptionFallback.cs
- ExpandedWrapper.cs
- Vector3DAnimationBase.cs
- errorpatternmatcher.cs
- MessagePropertyAttribute.cs
- HostingEnvironmentSection.cs
- ToolBarButtonClickEvent.cs
- InvalidFilterCriteriaException.cs
- SignatureToken.cs
- TreeNodeBindingCollection.cs
- SqlCommandSet.cs
- EntryPointNotFoundException.cs
- compensatingcollection.cs
- HtmlTitle.cs
- ListBoxAutomationPeer.cs
- ChannelEndpointElementCollection.cs
- TextRangeProviderWrapper.cs
- RotateTransform.cs
- InternalConfirm.cs
- ApplicationGesture.cs
- DataObjectCopyingEventArgs.cs
- OleDbReferenceCollection.cs
- WorkflowRuntimeServiceElementCollection.cs
- TranslateTransform.cs
- TrailingSpaceComparer.cs
- SqlDataSourceParameterParser.cs
- CodeTryCatchFinallyStatement.cs