Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / ArraySubsetEnumerator.cs / 1 / ArraySubsetEnumerator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.ComponentModel { using System; using System.Collections; using System.Diagnostics; using System.Security.Permissions; [HostProtection(SharedState = true)] internal class ArraySubsetEnumerator : IEnumerator { private Array array; private int total; private int current; public ArraySubsetEnumerator(Array array, int count) { Debug.Assert(count == 0 || array != null, "if array is null, count should be 0"); Debug.Assert(array == null || count <= array.Length, "Trying to enumerate more than the array contains"); this.array = array; this.total = count; current = -1; } public bool MoveNext() { if (current < total - 1) { current++; return true; } else { return false; } } public void Reset() { current = -1; } public object Current { get { if (current == -1) { throw new InvalidOperationException(); } else { return array.GetValue(current); } } } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WinCategoryAttribute.cs
- TemplateNodeContextMenu.cs
- SQLDouble.cs
- altserialization.cs
- XmlSerializableServices.cs
- PowerModeChangedEventArgs.cs
- JsonWriter.cs
- SqlIdentifier.cs
- ExtensionFile.cs
- CounterCreationDataCollection.cs
- TextViewElement.cs
- DllNotFoundException.cs
- ObservableCollection.cs
- ConstrainedDataObject.cs
- Wildcard.cs
- cryptoapiTransform.cs
- ToolboxItemFilterAttribute.cs
- SqlSelectStatement.cs
- LocationEnvironment.cs
- RectangleHotSpot.cs
- GridLength.cs
- BackoffTimeoutHelper.cs
- SimpleRecyclingCache.cs
- DomNameTable.cs
- XmlILConstructAnalyzer.cs
- UIPropertyMetadata.cs
- _Semaphore.cs
- GenericPrincipal.cs
- CalendarDay.cs
- Point3DIndependentAnimationStorage.cs
- GenericQueueSurrogate.cs
- Subset.cs
- DataPagerField.cs
- CryptoApi.cs
- PowerModeChangedEventArgs.cs
- _SingleItemRequestCache.cs
- Mutex.cs
- DateTimeOffset.cs
- CmsInterop.cs
- SystemGatewayIPAddressInformation.cs
- WebMethodAttribute.cs
- RootProjectionNode.cs
- UserControl.cs
- AsyncSerializedWorker.cs
- GetRecipientListRequest.cs
- JsonUriDataContract.cs
- OpenTypeLayoutCache.cs
- HtmlMeta.cs
- StrokeNodeOperations2.cs
- XmlSchemaDocumentation.cs
- LineGeometry.cs
- CodeTryCatchFinallyStatement.cs
- ZoneButton.cs
- TreeViewHitTestInfo.cs
- initElementDictionary.cs
- Marshal.cs
- NativeMethods.cs
- AlignmentYValidation.cs
- EntityTypeBase.cs
- ApplicationInfo.cs
- SqlDataAdapter.cs
- UrlPropertyAttribute.cs
- DeferredReference.cs
- EndpointConfigContainer.cs
- SortFieldComparer.cs
- ConnectionManagementSection.cs
- CommandSet.cs
- HandledEventArgs.cs
- MemoryRecordBuffer.cs
- TextRangeEditLists.cs
- RequestResponse.cs
- DependencyObject.cs
- CodeNamespace.cs
- PageTheme.cs
- PerformanceCounterCategory.cs
- Select.cs
- SHA384.cs
- CodeTypeDelegate.cs
- FileDialog_Vista_Interop.cs
- CqlGenerator.cs
- DateTimeConverter2.cs
- ScaleTransform3D.cs
- FileDialogCustomPlace.cs
- FormsAuthenticationUser.cs
- Marshal.cs
- EntityDescriptor.cs
- FixedHighlight.cs
- SafeBitVector32.cs
- DiscardableAttribute.cs
- ObjectQueryState.cs
- BindingManagerDataErrorEventArgs.cs
- InlinedAggregationOperatorEnumerator.cs
- RemotingClientProxy.cs
- FixedHyperLink.cs
- UIInitializationException.cs
- ClipboardProcessor.cs
- ProviderIncompatibleException.cs
- TableItemPattern.cs
- RelatedView.cs
- FlowchartDesignerCommands.cs