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
- PngBitmapDecoder.cs
- DrawingContext.cs
- GuidelineSet.cs
- MailDefinition.cs
- XmlSchemaSimpleTypeRestriction.cs
- BinarySecretSecurityToken.cs
- ConfigurationPermission.cs
- DataRowView.cs
- QueueProcessor.cs
- SqlVisitor.cs
- entityreference_tresulttype.cs
- WindowsTab.cs
- LabelLiteral.cs
- UserControlCodeDomTreeGenerator.cs
- ConfigDefinitionUpdates.cs
- TokenFactoryBase.cs
- TextRunProperties.cs
- DataGridViewAccessibleObject.cs
- CheckBoxField.cs
- WMICapabilities.cs
- ApplicationFileParser.cs
- Metadata.cs
- ActiveDocumentEvent.cs
- Single.cs
- SqlCacheDependencyDatabase.cs
- BooleanToVisibilityConverter.cs
- BasicViewGenerator.cs
- DataControlFieldCollection.cs
- InvalidOperationException.cs
- XmlReader.cs
- TabControl.cs
- AgileSafeNativeMemoryHandle.cs
- BitmapEncoder.cs
- UMPAttributes.cs
- SaveFileDialogDesigner.cs
- ComplexType.cs
- Compiler.cs
- InputScope.cs
- TheQuery.cs
- PhysicalAddress.cs
- Delay.cs
- SqlDataAdapter.cs
- Expression.cs
- StringWriter.cs
- InvalidOperationException.cs
- safesecurityhelperavalon.cs
- ScalarType.cs
- StrokeDescriptor.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- HwndHostAutomationPeer.cs
- OracleBoolean.cs
- TableSectionStyle.cs
- IPCCacheManager.cs
- MatrixIndependentAnimationStorage.cs
- CompilerParameters.cs
- AsymmetricSecurityProtocolFactory.cs
- CodeStatement.cs
- BitmapEffectDrawingContextWalker.cs
- CollectionViewGroupInternal.cs
- ConnectivityStatus.cs
- prompt.cs
- ToolStripItemBehavior.cs
- FileSystemInfo.cs
- XmlSchemaObjectTable.cs
- DataGridViewColumnStateChangedEventArgs.cs
- CodeGenerator.cs
- _NegoStream.cs
- DataMemberFieldConverter.cs
- ParameterModifier.cs
- XPathAxisIterator.cs
- ThreadBehavior.cs
- DocumentEventArgs.cs
- BrowserCapabilitiesFactoryBase.cs
- ScrollBar.cs
- DbDataSourceEnumerator.cs
- ObjectViewEntityCollectionData.cs
- VerticalAlignConverter.cs
- XsltConvert.cs
- SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs
- VScrollBar.cs
- Color.cs
- FieldCollectionEditor.cs
- UpdatePanelTrigger.cs
- MultiTrigger.cs
- JavaScriptString.cs
- PeerToPeerException.cs
- ErrorView.xaml.cs
- InputScope.cs
- DataGridHeaderBorder.cs
- DSASignatureDeformatter.cs
- WorkflowMarkupSerializationManager.cs
- Expression.DebuggerProxy.cs
- StdValidatorsAndConverters.cs
- Application.cs
- ExistsInCollection.cs
- UnsafeNativeMethods.cs
- TypeNameConverter.cs
- RawUIStateInputReport.cs
- EntityContainerEntitySet.cs
- ApplicationHost.cs