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
- GridViewPageEventArgs.cs
- Block.cs
- AppSecurityManager.cs
- InvokeBinder.cs
- WmlObjectListAdapter.cs
- DEREncoding.cs
- PrintPageEvent.cs
- ReverseQueryOperator.cs
- ExtendedPropertyCollection.cs
- PreDigestedSignedInfo.cs
- XamlPathDataSerializer.cs
- ProfileService.cs
- StringSorter.cs
- TableCellAutomationPeer.cs
- PathFigureCollection.cs
- ButtonFlatAdapter.cs
- ExtendedProtectionPolicy.cs
- ResolvePPIDRequest.cs
- MappingSource.cs
- DbgUtil.cs
- EFDataModelProvider.cs
- TableItemStyle.cs
- StorageRoot.cs
- ZipArchive.cs
- HelloMessageApril2005.cs
- ValidatedControlConverter.cs
- SafeRegistryHandle.cs
- CreateUserErrorEventArgs.cs
- ShapeTypeface.cs
- FieldNameLookup.cs
- ConnectionInterfaceCollection.cs
- SQLDecimalStorage.cs
- NetWebProxyFinder.cs
- GeometryCombineModeValidation.cs
- WebDisplayNameAttribute.cs
- WebPartZoneBase.cs
- WebPartConnection.cs
- DesignerProperties.cs
- ServicesSection.cs
- TimeIntervalCollection.cs
- DateTimeConverter2.cs
- ConfigXmlAttribute.cs
- ItemDragEvent.cs
- VSWCFServiceContractGenerator.cs
- NumberAction.cs
- ImmComposition.cs
- HandlerFactoryWrapper.cs
- SortDescriptionCollection.cs
- CodeAccessSecurityEngine.cs
- StringBuilder.cs
- PersistNameAttribute.cs
- DocumentApplicationJournalEntry.cs
- ColorTransformHelper.cs
- ServicePointManager.cs
- ReferencedAssembly.cs
- WebPart.cs
- ExpressionNormalizer.cs
- ReadOnlyCollectionBuilder.cs
- MetabaseSettings.cs
- DataSourceControlBuilder.cs
- VisualState.cs
- ConfigXmlAttribute.cs
- COM2ExtendedUITypeEditor.cs
- OleDbInfoMessageEvent.cs
- PropertyInfoSet.cs
- DrawListViewSubItemEventArgs.cs
- RuntimeResourceSet.cs
- StorageMappingItemLoader.cs
- CounterCreationDataConverter.cs
- TextEffectResolver.cs
- DataGridViewCheckBoxColumn.cs
- ThreadStartException.cs
- RuleInfoComparer.cs
- ISAPIWorkerRequest.cs
- WebPartManagerInternals.cs
- TdsParserStateObject.cs
- PropertyNames.cs
- PagePropertiesChangingEventArgs.cs
- ScriptManagerProxy.cs
- MatrixCamera.cs
- Attributes.cs
- EventTrigger.cs
- DropShadowBitmapEffect.cs
- SQLConvert.cs
- OdbcTransaction.cs
- XappLauncher.cs
- TypedDatasetGenerator.cs
- SimpleApplicationHost.cs
- DuplicateDetector.cs
- mansign.cs
- CurrentChangingEventManager.cs
- GroupBox.cs
- GrammarBuilderRuleRef.cs
- Variant.cs
- SafeThemeHandle.cs
- UnhandledExceptionEventArgs.cs
- WebBrowsableAttribute.cs
- ByteAnimation.cs
- InternalsVisibleToAttribute.cs
- CultureInfoConverter.cs