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
- PolicyException.cs
- sqlpipe.cs
- EDesignUtil.cs
- ZipIOFileItemStream.cs
- IsolatedStorageException.cs
- RemoteWebConfigurationHostStream.cs
- DocumentReferenceCollection.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- PrintPageEvent.cs
- DropDownList.cs
- FormView.cs
- MessageSmuggler.cs
- ArgIterator.cs
- DataServiceContext.cs
- CngKeyCreationParameters.cs
- WhereaboutsReader.cs
- XmlProcessingInstruction.cs
- CancellationToken.cs
- unsafeIndexingFilterStream.cs
- EventSetter.cs
- SqlClientWrapperSmiStreamChars.cs
- TriggerActionCollection.cs
- BitmapEffectInput.cs
- DESCryptoServiceProvider.cs
- RepeaterItemEventArgs.cs
- StreamFormatter.cs
- DbDataAdapter.cs
- EventProviderWriter.cs
- UxThemeWrapper.cs
- SerialPinChanges.cs
- MatrixValueSerializer.cs
- ArraySubsetEnumerator.cs
- XmlCharCheckingWriter.cs
- VoiceChangeEventArgs.cs
- JsonMessageEncoderFactory.cs
- InternalBufferManager.cs
- XPathSelfQuery.cs
- HtmlInputButton.cs
- MediaPlayerState.cs
- InputReportEventArgs.cs
- HyperLinkStyle.cs
- SyndicationContent.cs
- ObjectAnimationBase.cs
- Subtract.cs
- CodeMemberMethod.cs
- Item.cs
- SpnegoTokenProvider.cs
- _Win32.cs
- DesignerActionGlyph.cs
- PartitionResolver.cs
- GenericWebPart.cs
- UniformGrid.cs
- OletxDependentTransaction.cs
- ExpressionVisitorHelpers.cs
- XmlAttributeAttribute.cs
- TableItemPatternIdentifiers.cs
- ExtenderHelpers.cs
- InvalidPrinterException.cs
- XmlAttributeOverrides.cs
- Rotation3D.cs
- MessageSmuggler.cs
- SchemaImporterExtension.cs
- RadioButtonList.cs
- HostedBindingBehavior.cs
- ColorKeyFrameCollection.cs
- DataGridViewColumnDesigner.cs
- ToolStripSplitStackLayout.cs
- WinEventHandler.cs
- StrokeNodeData.cs
- XhtmlConformanceSection.cs
- ActiveXMessageFormatter.cs
- AssemblyUtil.cs
- MouseBinding.cs
- FormViewModeEventArgs.cs
- BidOverLoads.cs
- DBPropSet.cs
- Geometry.cs
- Deflater.cs
- SoapIncludeAttribute.cs
- DataTableNewRowEvent.cs
- RadioButtonList.cs
- DataGridViewAddColumnDialog.cs
- ProfilePropertyNameValidator.cs
- MenuItem.cs
- EntityWrapper.cs
- WebBrowserDocumentCompletedEventHandler.cs
- TemplatedWizardStep.cs
- TextServicesPropertyRanges.cs
- ListViewDataItem.cs
- RegisteredDisposeScript.cs
- HttpResponse.cs
- DesignBindingValueUIHandler.cs
- EnumDataContract.cs
- WebZone.cs
- PingOptions.cs
- FileSecurity.cs
- EmissiveMaterial.cs
- UTF32Encoding.cs
- DictionaryEditChange.cs
- DesignTimeParseData.cs