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
- MenuEventArgs.cs
- Listbox.cs
- GlobalProxySelection.cs
- LogicalExpr.cs
- unsafeIndexingFilterStream.cs
- InternalConfigConfigurationFactory.cs
- IssuanceTokenProviderState.cs
- SynchronizationContext.cs
- ScriptResourceInfo.cs
- ReverseComparer.cs
- SQLMembershipProvider.cs
- Update.cs
- RichTextBoxConstants.cs
- xmlformatgeneratorstatics.cs
- ConstructorArgumentAttribute.cs
- MapPathBasedVirtualPathProvider.cs
- BaseTemplateBuildProvider.cs
- Visual3D.cs
- SizeF.cs
- Attributes.cs
- OdbcParameter.cs
- FloaterBaseParaClient.cs
- Base64Encoder.cs
- InstallerTypeAttribute.cs
- ProcessModelInfo.cs
- ServiceErrorHandler.cs
- X509CertificateCollection.cs
- WorkflowExecutor.cs
- IconBitmapDecoder.cs
- login.cs
- ItemsControlAutomationPeer.cs
- XmlDeclaration.cs
- FixedNode.cs
- VisualTreeHelper.cs
- FrameworkPropertyMetadata.cs
- SystemWebCachingSectionGroup.cs
- PropertyRecord.cs
- TextSegment.cs
- BuildProviderCollection.cs
- GenericUriParser.cs
- SynchronizedPool.cs
- MaskInputRejectedEventArgs.cs
- TransactionProtocol.cs
- ValidateNames.cs
- ParameterModifier.cs
- TreeChangeInfo.cs
- TextPattern.cs
- StickyNoteHelper.cs
- QueryableFilterUserControl.cs
- GridViewItemAutomationPeer.cs
- AnimationLayer.cs
- ValueUnavailableException.cs
- PolicyUnit.cs
- SectionRecord.cs
- UserPersonalizationStateInfo.cs
- ByteStack.cs
- AssemblyName.cs
- WindowsListBox.cs
- DataKeyArray.cs
- Axis.cs
- ping.cs
- StatusBar.cs
- SmiSettersStream.cs
- Compensate.cs
- X509Extension.cs
- Clock.cs
- ApplicationGesture.cs
- HttpSocketManager.cs
- StreamingContext.cs
- EpmSyndicationContentSerializer.cs
- BooleanConverter.cs
- EntityDataSourceDataSelection.cs
- EncryptedPackageFilter.cs
- PriorityQueue.cs
- DataGridCell.cs
- xmlsaver.cs
- DetailsViewUpdateEventArgs.cs
- Grid.cs
- StreamUpgradeProvider.cs
- UserControl.cs
- ZipFileInfoCollection.cs
- AudioDeviceOut.cs
- XmlMemberMapping.cs
- EasingKeyFrames.cs
- BuildResult.cs
- SqlDataSourceFilteringEventArgs.cs
- AudioFileOut.cs
- CmsInterop.cs
- InputDevice.cs
- TextReader.cs
- UnsafeNativeMethods.cs
- PropertyContainer.cs
- WinEventWrap.cs
- FormsAuthenticationEventArgs.cs
- TransformPattern.cs
- ManualResetEventSlim.cs
- ToolStripGrip.cs
- OptimizerPatterns.cs
- MsmqInputMessagePool.cs
- CodeAttributeDeclarationCollection.cs