Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Xml / System / Xml / XPath / Internal / XPathArrayIterator.cs / 1 / 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
- SpecialTypeDataContract.cs
- EmbeddedMailObject.cs
- DecoderBestFitFallback.cs
- SecurityAppliedMessage.cs
- AuthenticatingEventArgs.cs
- HttpApplication.cs
- InvalidProgramException.cs
- DbBuffer.cs
- SurrogateEncoder.cs
- NameValueFileSectionHandler.cs
- DescendantQuery.cs
- TextCharacters.cs
- Transform3DGroup.cs
- XPathNodeIterator.cs
- ConfigurationManagerInternalFactory.cs
- KeyFrames.cs
- ServiceModelExtensionCollectionElement.cs
- SslStreamSecurityUpgradeProvider.cs
- WebPartActionVerb.cs
- SafeNativeMethodsMilCoreApi.cs
- AlternateViewCollection.cs
- OptimizedTemplateContentHelper.cs
- CodeGenHelper.cs
- TriggerBase.cs
- X509CertificateInitiatorClientCredential.cs
- DelayedRegex.cs
- MultiSelectRootGridEntry.cs
- LinkArea.cs
- TransportSecurityProtocol.cs
- SafeHandles.cs
- CodeMemberMethod.cs
- SchemaEntity.cs
- RegistrySecurity.cs
- Binding.cs
- ErrorFormatter.cs
- XmlLoader.cs
- ListDictionary.cs
- AnnotationHighlightLayer.cs
- MatrixAnimationUsingKeyFrames.cs
- PropertyRecord.cs
- JpegBitmapDecoder.cs
- MulticastDelegate.cs
- BypassElement.cs
- TracingConnectionInitiator.cs
- MessageDesigner.cs
- WhitespaceRuleReader.cs
- DataViewListener.cs
- DataSourceSelectArguments.cs
- KnownTypesHelper.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- FrameworkContentElement.cs
- NullRuntimeConfig.cs
- SmiMetaData.cs
- Helper.cs
- ExceptionValidationRule.cs
- InstanceDataCollectionCollection.cs
- PeerNameResolver.cs
- TransformerConfigurationWizardBase.cs
- ProfileSettings.cs
- ButtonBaseAdapter.cs
- ConnectionInterfaceCollection.cs
- RenderingBiasValidation.cs
- EntityDataSourceWrapper.cs
- PaintEvent.cs
- AppDomainAttributes.cs
- DataGridViewLinkCell.cs
- CellConstant.cs
- InputMethodStateTypeInfo.cs
- SqlCacheDependencyDatabase.cs
- BaseAsyncResult.cs
- MatrixTransform3D.cs
- FigureHelper.cs
- LocalizableAttribute.cs
- FrameDimension.cs
- ColorTransform.cs
- ByteStack.cs
- EncoderExceptionFallback.cs
- UIElement.cs
- _AutoWebProxyScriptWrapper.cs
- XPathQilFactory.cs
- DataServiceException.cs
- StorageEntityContainerMapping.cs
- WebServiceHostFactory.cs
- FrameDimension.cs
- ListenerElementsCollection.cs
- SiteOfOriginPart.cs
- MemoryPressure.cs
- _HeaderInfoTable.cs
- GlyphsSerializer.cs
- TypefaceMetricsCache.cs
- DocumentViewerHelper.cs
- BamlTreeMap.cs
- OleDbEnumerator.cs
- AmbientProperties.cs
- InstanceOwnerException.cs
- BookmarkEventArgs.cs
- ContentDefinition.cs
- MobileListItemCollection.cs
- OperationFormatStyle.cs