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
- SearchForVirtualItemEventArgs.cs
- Literal.cs
- ConstantExpression.cs
- CodeTypeParameter.cs
- QueueProcessor.cs
- SqlBooleanizer.cs
- RemoteWebConfigurationHostStream.cs
- SqlServices.cs
- EntityDataSourceChangedEventArgs.cs
- DataBoundControlHelper.cs
- ExpandoClass.cs
- Vector3DValueSerializer.cs
- Propagator.cs
- ButtonChrome.cs
- DataGridViewCheckBoxColumn.cs
- ActivityInterfaces.cs
- InternalTypeHelper.cs
- WindowsTitleBar.cs
- ContainerParaClient.cs
- UnmanagedMemoryStream.cs
- UrlMappingCollection.cs
- ByteStreamGeometryContext.cs
- ServiceHostingEnvironment.cs
- ScriptResourceHandler.cs
- HttpServerVarsCollection.cs
- PropertyGrid.cs
- State.cs
- NonVisualControlAttribute.cs
- SmtpClient.cs
- TraceListener.cs
- XDeferredAxisSource.cs
- DetailsViewModeEventArgs.cs
- HttpValueCollection.cs
- AssociationEndMember.cs
- UnmanagedHandle.cs
- TrackingCondition.cs
- TdsParserStaticMethods.cs
- Utils.cs
- DivideByZeroException.cs
- TextEditorMouse.cs
- ServiceDescriptionImporter.cs
- MsmqMessageSerializationFormat.cs
- XamlContextStack.cs
- StrokeDescriptor.cs
- Highlights.cs
- ToolboxBitmapAttribute.cs
- WizardSideBarListControlItem.cs
- SchemaObjectWriter.cs
- PreDigestedSignedInfo.cs
- ColorBuilder.cs
- CanonicalFontFamilyReference.cs
- LambdaCompiler.Address.cs
- TransformerConfigurationWizardBase.cs
- StrokeNodeOperations2.cs
- MouseCaptureWithinProperty.cs
- SimpleApplicationHost.cs
- StreamingContext.cs
- PassportAuthenticationModule.cs
- FixedSOMLineRanges.cs
- BufferedGraphicsContext.cs
- IconEditor.cs
- ThicknessAnimation.cs
- sortedlist.cs
- XmlSchemaSimpleTypeUnion.cs
- PagerSettings.cs
- RangeContentEnumerator.cs
- AdPostCacheSubstitution.cs
- GeneralTransform3DTo2D.cs
- HttpChannelListener.cs
- UnmanagedHandle.cs
- OracleRowUpdatedEventArgs.cs
- AncillaryOps.cs
- Image.cs
- DefaultAssemblyResolver.cs
- TableDetailsCollection.cs
- GridViewSelectEventArgs.cs
- BooleanProjectedSlot.cs
- ButtonChrome.cs
- BindingContext.cs
- WebMessageEncodingElement.cs
- DataGridViewCellFormattingEventArgs.cs
- WebPartConnectVerb.cs
- ModulesEntry.cs
- JournalEntry.cs
- BinHexDecoder.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- TypeListConverter.cs
- OperatorExpressions.cs
- CheckBoxFlatAdapter.cs
- OracleInternalConnection.cs
- XPathItem.cs
- RectAnimationBase.cs
- SmtpNtlmAuthenticationModule.cs
- CompiledAction.cs
- DbConnectionStringCommon.cs
- ToolStripOverflow.cs
- TimeSpanValidatorAttribute.cs
- ReflectionPermission.cs
- StringHandle.cs
- SimpleRecyclingCache.cs