Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / DummyDataSource.cs / 1305376 / 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; } } } } // 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
- FileLoadException.cs
- WebAdminConfigurationHelper.cs
- CodeSnippetExpression.cs
- Serializer.cs
- IProvider.cs
- Run.cs
- AttachedAnnotationChangedEventArgs.cs
- _AutoWebProxyScriptWrapper.cs
- IFlowDocumentViewer.cs
- ProviderConnectionPointCollection.cs
- HttpConfigurationSystem.cs
- FontEmbeddingManager.cs
- XamlVector3DCollectionSerializer.cs
- SerialPinChanges.cs
- ValidationError.cs
- SelectionItemPattern.cs
- LambdaExpression.cs
- DelegatingTypeDescriptionProvider.cs
- RowUpdatedEventArgs.cs
- TransformPattern.cs
- milexports.cs
- Regex.cs
- SimpleLine.cs
- ProtocolsSection.cs
- TextEditor.cs
- CommandField.cs
- ColorAnimationUsingKeyFrames.cs
- XPathNavigator.cs
- ZipIORawDataFileBlock.cs
- InertiaExpansionBehavior.cs
- KeyValuePairs.cs
- EventDescriptor.cs
- DataTemplate.cs
- TableLayoutSettingsTypeConverter.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- Panel.cs
- Simplifier.cs
- Helpers.cs
- DurationConverter.cs
- StrongBox.cs
- NativeRightsManagementAPIsStructures.cs
- SeparatorAutomationPeer.cs
- CipherData.cs
- FontCacheUtil.cs
- DataPagerField.cs
- StatusBarPanel.cs
- TypeExtensionConverter.cs
- TaskFormBase.cs
- COM2ComponentEditor.cs
- TogglePattern.cs
- XmlSchemaComplexContentRestriction.cs
- DefaultWorkflowLoaderService.cs
- HandleExceptionArgs.cs
- WsatConfiguration.cs
- PointLight.cs
- BindingSourceDesigner.cs
- TextRangeEditTables.cs
- DesignerOptions.cs
- RenderData.cs
- MustUnderstandBehavior.cs
- StringOutput.cs
- GroupBoxAutomationPeer.cs
- PassportAuthenticationEventArgs.cs
- SecurityHelper.cs
- ArcSegment.cs
- HighlightComponent.cs
- HttpListenerPrefixCollection.cs
- DataSourceHelper.cs
- MultiDataTrigger.cs
- MenuBase.cs
- PropertySegmentSerializationProvider.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ImageUrlEditor.cs
- CustomErrorsSection.cs
- TracePayload.cs
- Graph.cs
- XmlValidatingReaderImpl.cs
- InputScopeConverter.cs
- DataGridTableCollection.cs
- Vector.cs
- HtmlWindowCollection.cs
- EntityDataSourceSelectedEventArgs.cs
- HttpRequestMessageProperty.cs
- TdsValueSetter.cs
- Point3DCollection.cs
- CodeMemberEvent.cs
- RadioButton.cs
- ConfigsHelper.cs
- GPRECT.cs
- FormViewPagerRow.cs
- ComplexObject.cs
- FileSystemWatcher.cs
- InvokeGenerator.cs
- HttpValueCollection.cs
- RSAPKCS1KeyExchangeFormatter.cs
- SelectionHighlightInfo.cs
- XmlSchemaComplexContentRestriction.cs
- VisualState.cs
- ControlCollection.cs
- XmlSchemaComplexContentExtension.cs