Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- CodeLabeledStatement.cs
- Form.cs
- CheckBoxList.cs
- SignedInfo.cs
- Point3DIndependentAnimationStorage.cs
- IApplicationTrustManager.cs
- ArglessEventHandlerProxy.cs
- ControlTemplate.cs
- updateconfighost.cs
- BinaryFormatter.cs
- EventMappingSettingsCollection.cs
- SystemIPInterfaceProperties.cs
- SoapExtensionImporter.cs
- BoundField.cs
- RoleServiceManager.cs
- GeneratedCodeAttribute.cs
- SQLStringStorage.cs
- ResponseBodyWriter.cs
- MergablePropertyAttribute.cs
- EdmPropertyAttribute.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- XmlReflectionMember.cs
- ActivityDesignerResources.cs
- SqlParameter.cs
- DetailsViewRow.cs
- DbUpdateCommandTree.cs
- CodeAttributeDeclarationCollection.cs
- TileBrush.cs
- TextDataBindingHandler.cs
- RSAPKCS1SignatureFormatter.cs
- HttpCookieCollection.cs
- BasePropertyDescriptor.cs
- NavigatorOutput.cs
- AutomationIdentifier.cs
- RootBrowserWindowAutomationPeer.cs
- ListBox.cs
- SqlConnectionPoolProviderInfo.cs
- ResourceProviderFactory.cs
- LabelAutomationPeer.cs
- DataGridViewRowEventArgs.cs
- FunctionNode.cs
- AssemblyAttributes.cs
- SerializationStore.cs
- HostVisual.cs
- BuildDependencySet.cs
- TemplatedMailWebEventProvider.cs
- DbProviderSpecificTypePropertyAttribute.cs
- parserscommon.cs
- XmlReaderSettings.cs
- ViewCellSlot.cs
- SafeEventLogReadHandle.cs
- ComplusEndpointConfigContainer.cs
- WebBrowserHelper.cs
- QualificationDataAttribute.cs
- TableChangeProcessor.cs
- MetadataException.cs
- CommandConverter.cs
- FontEditor.cs
- FunctionImportMapping.cs
- FileVersionInfo.cs
- PagerSettings.cs
- InternalResources.cs
- PrimaryKeyTypeConverter.cs
- Thickness.cs
- PropertyChangedEventArgs.cs
- ViewValidator.cs
- WebPartMinimizeVerb.cs
- HttpApplication.cs
- XhtmlConformanceSection.cs
- VBIdentifierNameEditor.cs
- FontResourceCache.cs
- ControlCachePolicy.cs
- EntitySqlQueryCacheKey.cs
- GeneralTransform3DTo2DTo3D.cs
- WindowsRegion.cs
- IpcManager.cs
- RuntimeArgumentHandle.cs
- MailDefinition.cs
- PathSegmentCollection.cs
- FailedToStartupUIException.cs
- SocketElement.cs
- BypassElement.cs
- FacetChecker.cs
- TemplateFactory.cs
- FixUp.cs
- OleDbParameterCollection.cs
- ServicePointManagerElement.cs
- ProfilePropertyMetadata.cs
- DefaultWorkflowTransactionService.cs
- LostFocusEventManager.cs
- LinkButton.cs
- ListViewInsertionMark.cs
- ExtendedPropertyInfo.cs
- CodeConditionStatement.cs
- AutomationIdentifier.cs
- IndentedWriter.cs
- ResourceExpression.cs
- ReferenceConverter.cs
- TimeIntervalCollection.cs
- XmlSignificantWhitespace.cs