Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathArrayIterator.cs / 1305376 / XPathArrayIterator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- using System; using System.Collections; using System.Diagnostics; using System.Text; using System.Xml; using System.Xml.XPath; namespace MS.Internal.Xml.XPath { [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
- CellParagraph.cs
- IgnoreSectionHandler.cs
- EllipticalNodeOperations.cs
- Events.cs
- ListBox.cs
- TreeView.cs
- MaterialGroup.cs
- SqlDataAdapter.cs
- AssemblyEvidenceFactory.cs
- ReadWriteSpinLock.cs
- HtmlCalendarAdapter.cs
- RefreshEventArgs.cs
- _RequestCacheProtocol.cs
- DrawingGroupDrawingContext.cs
- GeneralTransform3DGroup.cs
- DiscardableAttribute.cs
- AesCryptoServiceProvider.cs
- SecurityIdentifierElement.cs
- ResourceReferenceExpressionConverter.cs
- ZipIOExtraFieldZip64Element.cs
- HttpProfileGroupBase.cs
- SafeFileMapViewHandle.cs
- ObjectComplexPropertyMapping.cs
- _NtlmClient.cs
- EventProviderWriter.cs
- FixedBufferAttribute.cs
- SqlBulkCopy.cs
- Timer.cs
- PeerNameRecord.cs
- Decorator.cs
- DataColumn.cs
- DescendantOverDescendantQuery.cs
- StringHandle.cs
- RootProjectionNode.cs
- WebServiceFaultDesigner.cs
- RayHitTestParameters.cs
- XNodeValidator.cs
- HttpResponseInternalWrapper.cs
- base64Transforms.cs
- SplitContainer.cs
- DockPanel.cs
- AstTree.cs
- ContractMapping.cs
- DataGridViewCellStyleBuilderDialog.cs
- TreeNodeEventArgs.cs
- GPPOINT.cs
- ColorBuilder.cs
- DeviceContext2.cs
- RtfControlWordInfo.cs
- FormCollection.cs
- TargetFrameworkAttribute.cs
- ColumnBinding.cs
- OpCopier.cs
- HtmlEmptyTagControlBuilder.cs
- FreezableCollection.cs
- MenuDesigner.cs
- DesignerTransactionCloseEvent.cs
- SamlAuthenticationClaimResource.cs
- MimeMultiPart.cs
- HtmlElement.cs
- WindowsRegion.cs
- MetadataProperty.cs
- BitmapEncoder.cs
- StringInfo.cs
- XmlBaseReader.cs
- Form.cs
- EncodingInfo.cs
- BrowserCapabilitiesFactoryBase.cs
- EUCJPEncoding.cs
- WebPartHelpVerb.cs
- HtmlShimManager.cs
- FixedSOMSemanticBox.cs
- SignerInfo.cs
- SectionRecord.cs
- MimeWriter.cs
- TextStore.cs
- StreamWriter.cs
- HScrollProperties.cs
- DisplayInformation.cs
- Menu.cs
- Overlapped.cs
- Latin1Encoding.cs
- ReadOnlyCollection.cs
- LayoutTable.cs
- WindowsIdentity.cs
- ListControl.cs
- XsdValidatingReader.cs
- FixedSOMPageConstructor.cs
- FileDataSourceCache.cs
- AnonymousIdentificationSection.cs
- TextTrailingCharacterEllipsis.cs
- ByteStack.cs
- ShaderEffect.cs
- UniqueIdentifierService.cs
- ListViewTableRow.cs
- EndEvent.cs
- HttpListenerResponse.cs
- ExpressionLexer.cs
- DataSourceSelectArguments.cs
- fixedPageContentExtractor.cs