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
- SelfIssuedAuthAsymmetricKey.cs
- DbMetaDataColumnNames.cs
- _ProxyChain.cs
- SafeNativeMethods.cs
- SHA512.cs
- SafeNativeMethodsCLR.cs
- ActivityDefaults.cs
- CookieProtection.cs
- ApplicationSecurityInfo.cs
- XmlDocumentFragment.cs
- ArglessEventHandlerProxy.cs
- SqlInternalConnectionSmi.cs
- DataServiceQuery.cs
- Rect3D.cs
- ProcessProtocolHandler.cs
- DataGridTableCollection.cs
- login.cs
- PreviewKeyDownEventArgs.cs
- ListViewTableCell.cs
- Expressions.cs
- TreeNodeMouseHoverEvent.cs
- ReaderWriterLock.cs
- SchemaAttDef.cs
- CollectionViewGroupRoot.cs
- WsdlBuildProvider.cs
- AggregateNode.cs
- NumericUpDown.cs
- MediaEntryAttribute.cs
- _SpnDictionary.cs
- ToggleProviderWrapper.cs
- BaseAsyncResult.cs
- TraceLevelStore.cs
- NetPipeSectionData.cs
- PropertyValueChangedEvent.cs
- GlyphTypeface.cs
- XslAstAnalyzer.cs
- EntitySetDataBindingList.cs
- ManagementException.cs
- LinkedResource.cs
- ProtocolState.cs
- TextEditorContextMenu.cs
- ActiveDesignSurfaceEvent.cs
- RangeBase.cs
- StringArrayConverter.cs
- ToolZone.cs
- XmlComment.cs
- SequenceDesigner.cs
- SoapMessage.cs
- BindingValueChangedEventArgs.cs
- SystemIcmpV6Statistics.cs
- CustomCredentialPolicy.cs
- EntityContainerEmitter.cs
- LambdaCompiler.ControlFlow.cs
- XmlSchemaSequence.cs
- ThemeableAttribute.cs
- MetaDataInfo.cs
- DataGridViewRowHeaderCell.cs
- ButtonChrome.cs
- GroupQuery.cs
- DocumentGridPage.cs
- HwndMouseInputProvider.cs
- SqlRetyper.cs
- GenericIdentity.cs
- _ContextAwareResult.cs
- RepeaterCommandEventArgs.cs
- SortQuery.cs
- IsolatedStorageFileStream.cs
- NativeMethodsOther.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- XmlNotation.cs
- MultipartIdentifier.cs
- Int64.cs
- BinaryReader.cs
- ObjectListCommandCollection.cs
- _ListenerResponseStream.cs
- CalendarDayButton.cs
- InputChannelBinder.cs
- SymbolMethod.cs
- DebugView.cs
- SecurityCriticalDataForSet.cs
- XmlDownloadManager.cs
- SpotLight.cs
- RepeatButtonAutomationPeer.cs
- TemplatedWizardStep.cs
- CalculatedColumn.cs
- HtmlInputCheckBox.cs
- CannotUnloadAppDomainException.cs
- CodeExporter.cs
- XmlCharType.cs
- TypeElementCollection.cs
- AutoResizedEvent.cs
- XmlConvert.cs
- HitTestFilterBehavior.cs
- WmlSelectionListAdapter.cs
- MessageBox.cs
- SimpleWebHandlerParser.cs
- ContextMarshalException.cs
- SafeWaitHandle.cs
- DesignerActionPropertyItem.cs
- WpfWebRequestHelper.cs