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
- UriSectionReader.cs
- LoginView.cs
- RoutedUICommand.cs
- CmsUtils.cs
- TypedElement.cs
- GenericAuthenticationEventArgs.cs
- TriState.cs
- ImageInfo.cs
- TraceHandler.cs
- SiteMapNode.cs
- ReflectEventDescriptor.cs
- DeviceContext2.cs
- EventHandlingScope.cs
- XmlChildEnumerator.cs
- UInt16.cs
- ScopedMessagePartSpecification.cs
- CollectionChangedEventManager.cs
- RewritingValidator.cs
- Stackframe.cs
- Function.cs
- TextElementAutomationPeer.cs
- SchemaObjectWriter.cs
- SpecialNameAttribute.cs
- NullableDecimalAverageAggregationOperator.cs
- SqlExpressionNullability.cs
- QilTypeChecker.cs
- DefaultTraceListener.cs
- WorkflowMarkupSerializationManager.cs
- FunctionParameter.cs
- AsyncOperationManager.cs
- ActiveXHost.cs
- Margins.cs
- RetriableClipboard.cs
- HttpWebRequest.cs
- CompModSwitches.cs
- HttpTransportManager.cs
- UserInitiatedRoutedEventPermission.cs
- StateMachineWorkflowDesigner.cs
- AuthenticationServiceManager.cs
- DurableEnlistmentState.cs
- ColorConverter.cs
- TailCallAnalyzer.cs
- BooleanFacetDescriptionElement.cs
- TypeHelper.cs
- ZipIOLocalFileHeader.cs
- CorrelationManager.cs
- DiscoveryDocumentSearchPattern.cs
- CryptoConfig.cs
- CallbackValidator.cs
- ControlUtil.cs
- BidOverLoads.cs
- ExpressionParser.cs
- DescendantOverDescendantQuery.cs
- WorkflowItemPresenter.cs
- SoapObjectReader.cs
- XmlDocument.cs
- MethodBuilder.cs
- SafeNativeMethods.cs
- SapiRecognizer.cs
- TraceLevelStore.cs
- ValidationRuleCollection.cs
- WindowsFont.cs
- ListViewItem.cs
- ConnectionStringsSection.cs
- ReferentialConstraint.cs
- DataGridTextBoxColumn.cs
- FrameworkContextData.cs
- MulticastNotSupportedException.cs
- ObjectAssociationEndMapping.cs
- WorkflowQueueInfo.cs
- DataBoundLiteralControl.cs
- CompareInfo.cs
- FileChangesMonitor.cs
- backend.cs
- BufferModesCollection.cs
- RedirectionProxy.cs
- ClassHandlersStore.cs
- PerformanceCounterManager.cs
- RadioButton.cs
- ContainerActivationHelper.cs
- SplitterCancelEvent.cs
- PassportAuthenticationModule.cs
- InputBinder.cs
- Condition.cs
- AnimatedTypeHelpers.cs
- ShapeTypeface.cs
- SmtpTransport.cs
- HierarchicalDataSourceControl.cs
- CheckBoxFlatAdapter.cs
- Thread.cs
- IgnoreSection.cs
- ServicePointManagerElement.cs
- VisualStyleTypesAndProperties.cs
- FontEmbeddingManager.cs
- CrossAppDomainChannel.cs
- ArgumentOutOfRangeException.cs
- JapaneseCalendar.cs
- StaticResourceExtension.cs
- AppDomain.cs
- RightsManagementEncryptedStream.cs