Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathArrayIterator.cs / 5 / 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
- DrawingCollection.cs
- DataControlFieldCell.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- XamlTreeBuilderBamlRecordWriter.cs
- Html32TextWriter.cs
- GroupBoxDesigner.cs
- HtmlTableCell.cs
- DesignerDataParameter.cs
- SqlWebEventProvider.cs
- InternalDispatchObject.cs
- StrokeNodeOperations.cs
- smtppermission.cs
- MarkupExtensionReturnTypeAttribute.cs
- XmlReaderSettings.cs
- WindowsRebar.cs
- AsymmetricSignatureDeformatter.cs
- ObjectToIdCache.cs
- TCPListener.cs
- SecurityTokenProvider.cs
- ListViewDeletedEventArgs.cs
- SQLSingle.cs
- TokenBasedSet.cs
- MailWebEventProvider.cs
- PropertyChange.cs
- ClientProtocol.cs
- Highlights.cs
- ZoomPercentageConverter.cs
- ListGeneralPage.cs
- BufferModeSettings.cs
- CorrelationResolver.cs
- ListItemCollection.cs
- StylusPointProperties.cs
- SelectiveScrollingGrid.cs
- StreamUpgradeBindingElement.cs
- CommandBindingCollection.cs
- TextMessageEncodingElement.cs
- HttpUnhandledOperationInvoker.cs
- ServicesUtilities.cs
- DataIdProcessor.cs
- _SslState.cs
- OracleParameterCollection.cs
- WindowAutomationPeer.cs
- AnyAllSearchOperator.cs
- ConnectionProviderAttribute.cs
- NavigateEvent.cs
- ClientUtils.cs
- ListItem.cs
- ColumnWidthChangingEvent.cs
- RectValueSerializer.cs
- SharedPersonalizationStateInfo.cs
- Interlocked.cs
- InputScopeNameConverter.cs
- UdpDiscoveryEndpoint.cs
- Transform.cs
- VerificationException.cs
- ServicePointManager.cs
- XPathEmptyIterator.cs
- WriteableBitmap.cs
- ToolStripGrip.cs
- DataGridViewCellStateChangedEventArgs.cs
- uribuilder.cs
- DocComment.cs
- CallbackValidatorAttribute.cs
- ExpandedProjectionNode.cs
- FontSource.cs
- TypeUtils.cs
- WorkflowElementDialog.cs
- MappingException.cs
- DSGeneratorProblem.cs
- ResourcePart.cs
- UserNameSecurityTokenProvider.cs
- ConfigXmlCDataSection.cs
- BitmapDecoder.cs
- Calendar.cs
- DefaultAsyncDataDispatcher.cs
- _NestedSingleAsyncResult.cs
- ButtonBase.cs
- HtmlTableRow.cs
- CreateUserWizardAutoFormat.cs
- ColorKeyFrameCollection.cs
- VirtualPath.cs
- StrongNameMembershipCondition.cs
- WindowsMenu.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- InputLanguageCollection.cs
- ObjectRef.cs
- precedingsibling.cs
- ValidationResult.cs
- basecomparevalidator.cs
- BamlCollectionHolder.cs
- ReadOnlyKeyedCollection.cs
- InkCanvasSelectionAdorner.cs
- TreeNodeEventArgs.cs
- MSAANativeProvider.cs
- WebPartDisplayModeCancelEventArgs.cs
- ArgumentOutOfRangeException.cs
- Stack.cs
- PrimitiveXmlSerializers.cs
- Span.cs