Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Collections / Generic / IEnumerable.cs / 1305376 / IEnumerable.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Interface: IEnumerable ** **[....] ** ** ** Purpose: Interface for providing generic IEnumerators ** ** ===========================================================*/ namespace System.Collections.Generic { using System; using System.Collections; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Diagnostics.Contracts; // Implement this interface if you need to support foreach semantics. // Note that T[] : IList, and we want to ensure that if you use // IList , we ensure a YourValueType[] can be used // without jitting. Hence the TypeDependencyAttribute on SZArrayHelper. // This is a special hack internally though - see VM\compile.cpp. // The same attribute is on IList and ICollection . [TypeDependencyAttribute("System.SZArrayHelper")] [ContractClass(typeof(IEnumerableContract<>))] #if FEATURE_CORECLR public interface IEnumerable : IEnumerable #if false { } #endif #else public interface IEnumerable : IEnumerable #endif { // Returns an IEnumerator for this enumerable Object. The enumerator provides // a simple way to access all the contents of a collection. /// new IEnumerator GetEnumerator(); } [ContractClassFor(typeof(IEnumerable<>))] internal class IEnumerableContract : System.Collections.IEnumerableContract, IEnumerable { [Pure] IEnumerator IEnumerable .GetEnumerator() { Contract.Ensures(Contract.Result >() != null); return default(IEnumerator ); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Interface: IEnumerable ** ** [....] ** ** ** Purpose: Interface for providing generic IEnumerators ** ** ===========================================================*/ namespace System.Collections.Generic { using System; using System.Collections; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Diagnostics.Contracts; // Implement this interface if you need to support foreach semantics. // Note that T[] : IList, and we want to ensure that if you use // IList , we ensure a YourValueType[] can be used // without jitting. Hence the TypeDependencyAttribute on SZArrayHelper. // This is a special hack internally though - see VM\compile.cpp. // The same attribute is on IList and ICollection . [TypeDependencyAttribute("System.SZArrayHelper")] [ContractClass(typeof(IEnumerableContract<>))] #if FEATURE_CORECLR public interface IEnumerable : IEnumerable #if false { } #endif #else public interface IEnumerable : IEnumerable #endif { // Returns an IEnumerator for this enumerable Object. The enumerator provides // a simple way to access all the contents of a collection. /// new IEnumerator GetEnumerator(); } [ContractClassFor(typeof(IEnumerable<>))] internal class IEnumerableContract : System.Collections.IEnumerableContract, IEnumerable { [Pure] IEnumerator IEnumerable .GetEnumerator() { Contract.Ensures(Contract.Result >() != null); return default(IEnumerator ); } } } // 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
- OrthographicCamera.cs
- MailAddressCollection.cs
- ContainerParaClient.cs
- ArrangedElementCollection.cs
- BatchParser.cs
- Header.cs
- ScrollContentPresenter.cs
- ScrollEventArgs.cs
- PrintingPermissionAttribute.cs
- tooltip.cs
- RecognizerStateChangedEventArgs.cs
- StreamGeometryContext.cs
- ColorMap.cs
- SendReply.cs
- XPathBinder.cs
- DummyDataSource.cs
- DependencyPropertyAttribute.cs
- Decimal.cs
- ClientSession.cs
- DataServiceResponse.cs
- MergeLocalizationDirectives.cs
- HttpListener.cs
- BitmapData.cs
- ValidatingReaderNodeData.cs
- TypeConstant.cs
- FileStream.cs
- SQlBooleanStorage.cs
- CodeBinaryOperatorExpression.cs
- CatalogZone.cs
- UITypeEditor.cs
- GridItemPatternIdentifiers.cs
- BaseValidator.cs
- ChameleonKey.cs
- ControlPropertyNameConverter.cs
- VBCodeProvider.cs
- ScrollData.cs
- SqlCacheDependencyDatabase.cs
- StyleHelper.cs
- OperationInfoBase.cs
- XPathException.cs
- OperationCanceledException.cs
- RepeatButton.cs
- SecurityDescriptor.cs
- PerformanceCounterManager.cs
- DocumentOrderQuery.cs
- X509CertificateValidator.cs
- HotSpot.cs
- ItemMap.cs
- HtmlElementCollection.cs
- ToolStripItem.cs
- PersonalizationProvider.cs
- IisTraceListener.cs
- WebScriptClientGenerator.cs
- SqlSupersetValidator.cs
- ActivityInterfaces.cs
- SystemFonts.cs
- TextRenderer.cs
- ObjectStateEntryDbDataRecord.cs
- TypeUnloadedException.cs
- CachingHintValidation.cs
- WindowsListViewSubItem.cs
- WebBrowserDesigner.cs
- List.cs
- JsonMessageEncoderFactory.cs
- ClonableStack.cs
- DataGridViewColumnTypeEditor.cs
- SmiMetaData.cs
- FormatSelectingMessageInspector.cs
- Descriptor.cs
- HtmlInputControl.cs
- EmptyStringExpandableObjectConverter.cs
- ManualWorkflowSchedulerService.cs
- ListenerConnectionModeReader.cs
- CommonDialog.cs
- UpdateEventArgs.cs
- XmlEncodedRawTextWriter.cs
- OperationInvokerTrace.cs
- CollectionTypeElement.cs
- ServicePointManager.cs
- EntityClientCacheKey.cs
- XmlSchemaSimpleTypeRestriction.cs
- RemoveFromCollection.cs
- TypeConverterValueSerializer.cs
- DetailsViewUpdatedEventArgs.cs
- LineServices.cs
- TypedTableGenerator.cs
- dtdvalidator.cs
- DynamicILGenerator.cs
- ObjectResult.cs
- VectorCollectionValueSerializer.cs
- ParsedAttributeCollection.cs
- MethodBuilder.cs
- StyleTypedPropertyAttribute.cs
- DispatcherObject.cs
- DefaultPropertiesToSend.cs
- Listbox.cs
- BlobPersonalizationState.cs
- SoapMessage.cs
- ResolvedKeyFrameEntry.cs
- AssemblyBuilder.cs