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
- followingsibling.cs
- NamespaceCollection.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- DataGridViewRowPrePaintEventArgs.cs
- ClientCredentialsSecurityTokenManager.cs
- ButtonRenderer.cs
- TextPointer.cs
- ButtonField.cs
- PrintControllerWithStatusDialog.cs
- TextRenderer.cs
- OdbcCommand.cs
- WorkflowTransactionService.cs
- WsdlWriter.cs
- SizeAnimation.cs
- ListCollectionView.cs
- WebServiceData.cs
- ColorTransform.cs
- Parsers.cs
- HyperLink.cs
- OutKeywords.cs
- SmtpDigestAuthenticationModule.cs
- DataGridCell.cs
- TemplateBindingExpression.cs
- DataStreamFromComStream.cs
- PathSegment.cs
- Matrix.cs
- CompilerTypeWithParams.cs
- RepeaterItemCollection.cs
- xmlglyphRunInfo.cs
- BamlRecordHelper.cs
- XmlHierarchicalDataSourceView.cs
- Constraint.cs
- UriSection.cs
- PassportAuthentication.cs
- SafeBitVector32.cs
- AttributeCollection.cs
- SafeFileMappingHandle.cs
- QilInvokeLateBound.cs
- Hex.cs
- XPathScanner.cs
- NegotiateStream.cs
- BitmapData.cs
- ProfileService.cs
- FixedSOMPageElement.cs
- SimpleLine.cs
- ErrorWrapper.cs
- TriggerCollection.cs
- BaseTemplateBuildProvider.cs
- DbConnectionPoolOptions.cs
- StickyNoteAnnotations.cs
- CompositeFontInfo.cs
- KeyNotFoundException.cs
- MemoryMappedView.cs
- AppDomainCompilerProxy.cs
- CollectionType.cs
- HttpWriter.cs
- ConditionalWeakTable.cs
- DataGridLinkButton.cs
- ToolStripContainerActionList.cs
- SimpleType.cs
- HtmlForm.cs
- RowParagraph.cs
- EntitySqlQueryState.cs
- MissingMemberException.cs
- WebPartsPersonalization.cs
- PageRequestManager.cs
- DataGridTable.cs
- StatusBarPanelClickEvent.cs
- MSHTMLHost.cs
- TypeToken.cs
- XmlSerializerSection.cs
- DebugHandleTracker.cs
- _ListenerAsyncResult.cs
- ResourceType.cs
- XmlSecureResolver.cs
- PropertyTabAttribute.cs
- QilSortKey.cs
- ScrollContentPresenter.cs
- InheritedPropertyDescriptor.cs
- MonitoringDescriptionAttribute.cs
- ScriptingRoleServiceSection.cs
- Soap12ProtocolReflector.cs
- MemoryStream.cs
- SvcMapFile.cs
- SerializationInfo.cs
- RequestCacheManager.cs
- WizardStepBase.cs
- NativeMethods.cs
- ResourceExpressionBuilder.cs
- JsonObjectDataContract.cs
- AutomationTextAttribute.cs
- DataPagerFieldCollection.cs
- SiteOfOriginContainer.cs
- ChtmlPhoneCallAdapter.cs
- Merger.cs
- WebPartConnectionsConnectVerb.cs
- TabControlEvent.cs
- Int64Storage.cs
- SafeEventLogWriteHandle.cs
- AssemblyResourceLoader.cs