Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebControls / DummyDataSource.cs / 1 / DummyDataSource.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System;
using System.Collections;
///
///
internal sealed class DummyDataSource : ICollection {
private int dataItemCount;
internal DummyDataSource(int dataItemCount) {
this.dataItemCount = dataItemCount;
}
public int Count {
get {
return dataItemCount;
}
}
public bool IsSynchronized {
get {
return false;
}
}
public Object SyncRoot {
get {
return this;
}
}
public void CopyTo(Array array, int index) {
for (IEnumerator e = this.GetEnumerator(); e.MoveNext();)
array.SetValue(e.Current, index++);
}
public IEnumerator GetEnumerator() {
return new DummyDataSourceEnumerator(dataItemCount);
}
private class DummyDataSourceEnumerator : IEnumerator {
private int count;
private int index;
public DummyDataSourceEnumerator(int count) {
this.count = count;
this.index = -1;
}
public object Current {
get {
return null;
}
}
public bool MoveNext() {
index++;
return index < count;
}
public void Reset() {
this.index = -1;
}
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FixedPageAutomationPeer.cs
- RelationshipWrapper.cs
- ExtensionSimplifierMarkupObject.cs
- HMACRIPEMD160.cs
- DeferrableContent.cs
- XmlReflectionMember.cs
- MediaContextNotificationWindow.cs
- Rotation3DAnimation.cs
- ExpandCollapseProviderWrapper.cs
- ServicePointManagerElement.cs
- StreamAsIStream.cs
- XmlSchemas.cs
- WorkflowRuntimeServiceElement.cs
- ProxyWebPartConnectionCollection.cs
- ControlBindingsCollection.cs
- XamlWrappingReader.cs
- PhysicalAddress.cs
- OrderedParallelQuery.cs
- CompensableActivity.cs
- ModelFunctionTypeElement.cs
- SqlGatherProducedAliases.cs
- TraceLevelStore.cs
- InputManager.cs
- FileUtil.cs
- PropertyGeneratedEventArgs.cs
- BaseCodeDomTreeGenerator.cs
- XmlDataCollection.cs
- ViewCellRelation.cs
- ChtmlPhoneCallAdapter.cs
- Version.cs
- TextModifierScope.cs
- EventSourceCreationData.cs
- TreeNodeCollectionEditorDialog.cs
- NamedPermissionSet.cs
- DependencyProperty.cs
- PropertyKey.cs
- TextTreeDeleteContentUndoUnit.cs
- Pair.cs
- KeyTime.cs
- FormattedTextSymbols.cs
- SchemaExporter.cs
- InheritablePropertyChangeInfo.cs
- IdentifierElement.cs
- NCryptSafeHandles.cs
- ComponentConverter.cs
- login.cs
- TraceContext.cs
- WindowsTitleBar.cs
- SourceSwitch.cs
- ReadOnlyMetadataCollection.cs
- InputBinder.cs
- PasswordTextContainer.cs
- InvalidCommandTreeException.cs
- DoubleAnimation.cs
- WebPartConnectionsConfigureVerb.cs
- CodeConstructor.cs
- ContentFileHelper.cs
- XmlAttributeProperties.cs
- WaitForChangedResult.cs
- NewArray.cs
- UTF8Encoding.cs
- FormView.cs
- RowVisual.cs
- XPathDocumentBuilder.cs
- PngBitmapDecoder.cs
- FormsAuthenticationConfiguration.cs
- HwndKeyboardInputProvider.cs
- ProxySimple.cs
- Point3DConverter.cs
- SqlException.cs
- GC.cs
- Int16Storage.cs
- WebProxyScriptElement.cs
- TextBoxAutoCompleteSourceConverter.cs
- TypeHelper.cs
- MultipartIdentifier.cs
- ToolStripSettings.cs
- SemanticAnalyzer.cs
- Helpers.cs
- StateDesigner.LayoutSelectionGlyph.cs
- TransformProviderWrapper.cs
- XmlQueryStaticData.cs
- StatusBarDrawItemEvent.cs
- DragEventArgs.cs
- DataGridCaption.cs
- SchemaImporterExtension.cs
- MaskedTextBoxDesigner.cs
- XmlSchemaFacet.cs
- LeaseManager.cs
- ClientData.cs
- SemanticResolver.cs
- AffineTransform3D.cs
- PathSegmentCollection.cs
- TraceContextRecord.cs
- SimplePropertyEntry.cs
- XmlNode.cs
- CollectionContainer.cs
- ControlEvent.cs
- ColumnPropertiesGroup.cs
- PropertyGridEditorPart.cs