Code:
/ DotNET / DotNET / 8.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
- Pkcs7Signer.cs
- IItemProperties.cs
- Size.cs
- ConditionCollection.cs
- PrintingPermissionAttribute.cs
- CellConstant.cs
- TailPinnedEventArgs.cs
- WindowInteractionStateTracker.cs
- CompositeCollectionView.cs
- OdbcUtils.cs
- ChangePassword.cs
- Camera.cs
- CharEnumerator.cs
- AuthenticationManager.cs
- SqlProfileProvider.cs
- MonitorWrapper.cs
- EncryptedKeyHashIdentifierClause.cs
- DecoderFallback.cs
- DictionaryCustomTypeDescriptor.cs
- OleDbReferenceCollection.cs
- ListBoxAutomationPeer.cs
- CanExecuteRoutedEventArgs.cs
- ConfigurationStrings.cs
- UInt16.cs
- CapabilitiesAssignment.cs
- AppDomainManager.cs
- RNGCryptoServiceProvider.cs
- RegexReplacement.cs
- ThicknessKeyFrameCollection.cs
- DataServiceRequestOfT.cs
- IdentityVerifier.cs
- HostingEnvironmentWrapper.cs
- WindowClosedEventArgs.cs
- ScaleTransform3D.cs
- ToolBarButtonDesigner.cs
- PhysicalAddress.cs
- PathFigure.cs
- InputScopeNameConverter.cs
- ISSmlParser.cs
- SiteMapDataSourceView.cs
- SqlDataSourceDesigner.cs
- ButtonBaseAdapter.cs
- DataReceivedEventArgs.cs
- DrawItemEvent.cs
- SoapCodeExporter.cs
- CodeDomDecompiler.cs
- TextServicesCompartmentEventSink.cs
- StrokeCollectionConverter.cs
- SymbolType.cs
- MimeParameter.cs
- PackageRelationshipCollection.cs
- GridItem.cs
- AppSettingsExpressionBuilder.cs
- WebPartDisplayMode.cs
- ping.cs
- FastEncoder.cs
- EntityStoreSchemaGenerator.cs
- CodeDomConfigurationHandler.cs
- SystemInfo.cs
- ContentFileHelper.cs
- KoreanCalendar.cs
- ConstraintConverter.cs
- ToolStripContainer.cs
- SequenceQuery.cs
- GridItemPattern.cs
- UInt64Storage.cs
- InputReportEventArgs.cs
- ObjectSet.cs
- MetaModel.cs
- ApplicationActivator.cs
- HostProtectionException.cs
- UiaCoreApi.cs
- UpDownBase.cs
- NativeMethods.cs
- SmtpNegotiateAuthenticationModule.cs
- SqlRecordBuffer.cs
- DirectoryInfo.cs
- Pool.cs
- TreeNodeBindingCollection.cs
- TransformationRules.cs
- MemberRelationshipService.cs
- SmtpNegotiateAuthenticationModule.cs
- SliderAutomationPeer.cs
- XamlParser.cs
- RefType.cs
- ButtonStandardAdapter.cs
- RelatedCurrencyManager.cs
- WebControlAdapter.cs
- NextPreviousPagerField.cs
- IntSecurity.cs
- InternalConfigSettingsFactory.cs
- Propagator.Evaluator.cs
- TextBoxAutoCompleteSourceConverter.cs
- CookielessData.cs
- ComponentChangingEvent.cs
- TemplateParser.cs
- WebPartTransformer.cs
- LazyTextWriterCreator.cs
- SecurityTokenException.cs
- EdgeModeValidation.cs