Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / ArraySubsetEnumerator.cs / 1305376 / 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); } } } } } // 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
- FocusManager.cs
- ScrollViewer.cs
- TraceHwndHost.cs
- SafeReversePInvokeHandle.cs
- BinHexEncoder.cs
- BehaviorEditorPart.cs
- SuppressMergeCheckAttribute.cs
- NoPersistProperty.cs
- SafeMILHandle.cs
- EventToken.cs
- GridItemCollection.cs
- CacheSection.cs
- DetailsViewModeEventArgs.cs
- SqlTrackingService.cs
- ToolStripLabel.cs
- EventRoute.cs
- nulltextnavigator.cs
- shaperfactory.cs
- SqlDataSourceView.cs
- EncoderNLS.cs
- SqlTypesSchemaImporter.cs
- BrowsableAttribute.cs
- ChannelPoolSettings.cs
- Comparer.cs
- BooleanSwitch.cs
- SqlDataSourceRefreshSchemaForm.cs
- UIntPtr.cs
- invalidudtexception.cs
- QueryValue.cs
- ReadOnlyActivityGlyph.cs
- ShaperBuffers.cs
- DbTypeMap.cs
- UrlPath.cs
- IdleTimeoutMonitor.cs
- CompilationLock.cs
- ListControlBuilder.cs
- StringFreezingAttribute.cs
- RawContentTypeMapper.cs
- LateBoundBitmapDecoder.cs
- HttpBrowserCapabilitiesBase.cs
- OleDbPropertySetGuid.cs
- WorkflowTraceTransfer.cs
- FontCacheUtil.cs
- SystemPens.cs
- DictionaryContent.cs
- AssociationTypeEmitter.cs
- SessionStateModule.cs
- TraceHandler.cs
- EventBuilder.cs
- recordstate.cs
- InstallerTypeAttribute.cs
- TypeLoadException.cs
- IDQuery.cs
- CommittableTransaction.cs
- TypedAsyncResult.cs
- SelectionEditingBehavior.cs
- TextBreakpoint.cs
- FixedSOMTextRun.cs
- SqlReferenceCollection.cs
- GeneralTransform2DTo3DTo2D.cs
- SqlUserDefinedAggregateAttribute.cs
- LexicalChunk.cs
- ElementsClipboardData.cs
- CheckBox.cs
- ListSurrogate.cs
- PropertyDescriptorComparer.cs
- BulletedListEventArgs.cs
- BindingSource.cs
- OutKeywords.cs
- SafeSecurityHandles.cs
- SqlServices.cs
- FixedSOMPageElement.cs
- CacheVirtualItemsEvent.cs
- FunctionDescription.cs
- XmlValueConverter.cs
- DocumentXPathNavigator.cs
- LineSegment.cs
- StrongNameIdentityPermission.cs
- DurationConverter.cs
- FixedSOMTable.cs
- ObjectNotFoundException.cs
- ApplicationManager.cs
- Point3DAnimationUsingKeyFrames.cs
- DBNull.cs
- SecureStringHasher.cs
- ScrollViewer.cs
- ObjectStorage.cs
- TraceSwitch.cs
- NamedObject.cs
- DocumentPage.cs
- ValidationSummary.cs
- VariableBinder.cs
- FileLogRecordStream.cs
- ClientType.cs
- Directory.cs
- XPathPatternParser.cs
- ItemList.cs
- TemplateControlBuildProvider.cs
- BitmapSource.cs
- Panel.cs