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
- Rijndael.cs
- CFGGrammar.cs
- PathParser.cs
- DataErrorValidationRule.cs
- HitTestParameters.cs
- Rect3D.cs
- DataServiceHost.cs
- ToolStripComboBox.cs
- SkinBuilder.cs
- DuplexChannelBinder.cs
- HttpPostServerProtocol.cs
- DriveNotFoundException.cs
- TimeEnumHelper.cs
- VersionedStreamOwner.cs
- BamlBinaryWriter.cs
- NonVisualControlAttribute.cs
- AdCreatedEventArgs.cs
- AppModelKnownContentFactory.cs
- SqlDataSourceFilteringEventArgs.cs
- CriticalExceptions.cs
- XmlConverter.cs
- EvidenceBase.cs
- PopupRoot.cs
- EntityViewGenerationConstants.cs
- Marshal.cs
- DataServiceConfiguration.cs
- SecurityContext.cs
- SystemPens.cs
- LocalFileSettingsProvider.cs
- ToolStripTemplateNode.cs
- XmlTextReaderImpl.cs
- IItemProperties.cs
- Path.cs
- XmlCharType.cs
- ToolStripOverflowButton.cs
- PropertyExpression.cs
- ColorAnimationBase.cs
- LayoutTable.cs
- SchemaElement.cs
- columnmapkeybuilder.cs
- WebPartChrome.cs
- DataRowChangeEvent.cs
- CodeMethodReturnStatement.cs
- ModuleConfigurationInfo.cs
- CodeGenerator.cs
- KeyEventArgs.cs
- WebPartManager.cs
- OracleConnectionFactory.cs
- GeometryHitTestResult.cs
- ImageAttributes.cs
- XmlSerializationWriter.cs
- CodeDirectionExpression.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- WebBaseEventKeyComparer.cs
- BuilderInfo.cs
- DesignTimeTemplateParser.cs
- GridPattern.cs
- OrderedParallelQuery.cs
- BamlRecords.cs
- PKCS1MaskGenerationMethod.cs
- ThreadAttributes.cs
- ExpanderAutomationPeer.cs
- DataMemberAttribute.cs
- PropertyPathConverter.cs
- CAGDesigner.cs
- DataTableMappingCollection.cs
- Label.cs
- HScrollBar.cs
- DWriteFactory.cs
- SqlInternalConnectionTds.cs
- ExpressionLexer.cs
- CodeMemberEvent.cs
- FunctionOverloadResolver.cs
- FontNamesConverter.cs
- DLinqDataModelProvider.cs
- DataGridItem.cs
- LineProperties.cs
- coordinatorfactory.cs
- DbTypeMap.cs
- X509SecurityTokenProvider.cs
- Resources.Designer.cs
- LoginView.cs
- TextSchema.cs
- Selector.cs
- HttpCapabilitiesBase.cs
- X509PeerCertificateAuthentication.cs
- SubclassTypeValidator.cs
- RectangleHotSpot.cs
- GeneralTransform3DCollection.cs
- ObjectStateEntry.cs
- UnknownWrapper.cs
- EntityContainerAssociationSetEnd.cs
- DataColumn.cs
- BitmapData.cs
- util.cs
- ResolvedKeyFrameEntry.cs
- SessionEndedEventArgs.cs
- RoutedEventValueSerializer.cs
- ASCIIEncoding.cs
- XmlWhitespace.cs