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
- SegmentTree.cs
- AutoGeneratedField.cs
- DocumentsTrace.cs
- DataListItem.cs
- DoubleCollection.cs
- MdiWindowListStrip.cs
- DefaultValueMapping.cs
- HyperLinkColumn.cs
- ScriptingSectionGroup.cs
- ListCommandEventArgs.cs
- recordstatefactory.cs
- TypeConverterHelper.cs
- ContentHostHelper.cs
- CqlBlock.cs
- HeaderCollection.cs
- URLString.cs
- DbConnectionClosed.cs
- _DisconnectOverlappedAsyncResult.cs
- remotingproxy.cs
- SignedPkcs7.cs
- UshortList2.cs
- SiteMap.cs
- XomlCompilerHelpers.cs
- MatrixTransform3D.cs
- ContainerVisual.cs
- HwndSourceKeyboardInputSite.cs
- ObjectView.cs
- TextTreeTextBlock.cs
- ListBase.cs
- EmptyElement.cs
- EntityAdapter.cs
- DtdParser.cs
- SoapFaultCodes.cs
- WebPartsSection.cs
- DiagnosticSection.cs
- ExtenderProvidedPropertyAttribute.cs
- DataServiceHostWrapper.cs
- MarkupExtensionParser.cs
- SoapAttributeOverrides.cs
- _SslStream.cs
- wgx_exports.cs
- SmuggledIUnknown.cs
- IsolatedStorageFilePermission.cs
- IntranetCredentialPolicy.cs
- FilteredXmlReader.cs
- OpenFileDialog.cs
- _HelperAsyncResults.cs
- UriWriter.cs
- ClientScriptManagerWrapper.cs
- WebZoneDesigner.cs
- AttachedPropertyDescriptor.cs
- _OverlappedAsyncResult.cs
- SoapFault.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- ReachPrintTicketSerializer.cs
- Point3DConverter.cs
- ChangeTracker.cs
- SafeNativeMethods.cs
- _ProxyChain.cs
- Blend.cs
- CrossAppDomainChannel.cs
- ColorConverter.cs
- DrawItemEvent.cs
- Math.cs
- WeakReferenceEnumerator.cs
- DataServicePagingProviderWrapper.cs
- LogWriteRestartAreaState.cs
- ModelFactory.cs
- UserMapPath.cs
- NetworkInformationPermission.cs
- DecodeHelper.cs
- BlurEffect.cs
- DSACryptoServiceProvider.cs
- LinqDataSourceInsertEventArgs.cs
- MimeTypeMapper.cs
- EventsTab.cs
- CodeVariableReferenceExpression.cs
- SqlUnionizer.cs
- ColorAnimationUsingKeyFrames.cs
- BadImageFormatException.cs
- MasterPageBuildProvider.cs
- Mapping.cs
- Int32CAMarshaler.cs
- HtmlUtf8RawTextWriter.cs
- WithParamAction.cs
- propertytag.cs
- CreateUserWizard.cs
- GifBitmapEncoder.cs
- SelectionItemProviderWrapper.cs
- Rotation3DAnimationBase.cs
- CustomDictionarySources.cs
- BrowsableAttribute.cs
- MaterializeFromAtom.cs
- BindingFormattingDialog.cs
- ApplicationManager.cs
- CompilerInfo.cs
- Action.cs
- ITextView.cs
- __Error.cs
- WorkflowApplicationException.cs