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
- RichTextBox.cs
- ServiceReference.cs
- EntitySetBase.cs
- DefaultHttpHandler.cs
- XPathDocumentBuilder.cs
- ControlOperationBehavior.cs
- XPathEmptyIterator.cs
- SchemaNames.cs
- ValidatingPropertiesEventArgs.cs
- DataServiceRequestOfT.cs
- NetworkInformationException.cs
- PropertyDescriptorCollection.cs
- Substitution.cs
- HostExecutionContextManager.cs
- PanelStyle.cs
- HelpKeywordAttribute.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- NonSerializedAttribute.cs
- CodeStatementCollection.cs
- FreezableDefaultValueFactory.cs
- SqlDataSourceStatusEventArgs.cs
- EmptyEnumerator.cs
- XXXOnTypeBuilderInstantiation.cs
- ValidatingPropertiesEventArgs.cs
- hebrewshape.cs
- ReadOnlyPropertyMetadata.cs
- SByteConverter.cs
- CompilerWrapper.cs
- PinnedBufferMemoryStream.cs
- DataGridViewCheckBoxCell.cs
- ChangePassword.cs
- ProviderSettingsCollection.cs
- DrawingDrawingContext.cs
- MdImport.cs
- CombinedGeometry.cs
- SamlDelegatingWriter.cs
- ListenUriMode.cs
- RtfControls.cs
- WindowsRegion.cs
- Keyboard.cs
- relpropertyhelper.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- RenderOptions.cs
- PrivilegedConfigurationManager.cs
- HTMLTextWriter.cs
- HtmlTableCell.cs
- X509ChainPolicy.cs
- GorillaCodec.cs
- TopClause.cs
- MembershipPasswordException.cs
- BuilderPropertyEntry.cs
- TargetPerspective.cs
- SubpageParagraph.cs
- SqlNodeAnnotation.cs
- _CookieModule.cs
- DataGridLinkButton.cs
- GlyphShapingProperties.cs
- XsltSettings.cs
- WebPermission.cs
- DeflateEmulationStream.cs
- StringStorage.cs
- DependencyObjectPropertyDescriptor.cs
- ConfigurationValue.cs
- Bidi.cs
- ColumnHeader.cs
- mactripleDES.cs
- PropertyNames.cs
- PrintPreviewControl.cs
- DataColumn.cs
- AuthenticateEventArgs.cs
- GenericWebPart.cs
- Delay.cs
- TypedElement.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- XmlDictionaryReaderQuotas.cs
- SQLMembershipProvider.cs
- BamlLocalizableResourceKey.cs
- MemoryPressure.cs
- IIS7UserPrincipal.cs
- DataSourceHelper.cs
- InProcStateClientManager.cs
- XmlSchemaValidationException.cs
- DataServiceQuery.cs
- COMException.cs
- Assembly.cs
- SignatureHelper.cs
- ImportedNamespaceContextItem.cs
- CompModSwitches.cs
- CrossSiteScriptingValidation.cs
- AuthenticationService.cs
- RawKeyboardInputReport.cs
- SchemaTypeEmitter.cs
- TdsParserStaticMethods.cs
- DynamicEndpointElement.cs
- DefaultPrintController.cs
- DateTimeFormatInfo.cs
- BufferBuilder.cs
- WebBrowserDocumentCompletedEventHandler.cs
- EntityDataSourceUtil.cs
- RuleValidation.cs