Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Wildcard.cs
- COM2ExtendedBrowsingHandler.cs
- SrgsGrammarCompiler.cs
- ConvertersCollection.cs
- ErrorHandler.cs
- SimpleType.cs
- Point4DConverter.cs
- SecurityHeaderTokenResolver.cs
- InternalConfigEventArgs.cs
- Model3DGroup.cs
- DataListCommandEventArgs.cs
- ConditionalAttribute.cs
- Cursor.cs
- StreamGeometryContext.cs
- IntegrationExceptionEventArgs.cs
- DelimitedListTraceListener.cs
- ResourcePool.cs
- ControlBindingsCollection.cs
- DmlSqlGenerator.cs
- ModelChangedEventArgsImpl.cs
- FixedSOMImage.cs
- Rectangle.cs
- CollectionBase.cs
- ServiceOperationParameter.cs
- IODescriptionAttribute.cs
- AnnotationHighlightLayer.cs
- AdornerPresentationContext.cs
- SqlUserDefinedTypeAttribute.cs
- LogicalChannel.cs
- XmlMemberMapping.cs
- BindingSourceDesigner.cs
- CreateRefExpr.cs
- CounterSample.cs
- ProfileServiceManager.cs
- FixedHyperLink.cs
- CodeVariableDeclarationStatement.cs
- StylusPointProperty.cs
- ToolStripCodeDomSerializer.cs
- oledbmetadatacolumnnames.cs
- ClientFormsAuthenticationMembershipProvider.cs
- ConfigXmlAttribute.cs
- XamlDesignerSerializationManager.cs
- ExtensionSimplifierMarkupObject.cs
- SessionParameter.cs
- UserValidatedEventArgs.cs
- EntityParameterCollection.cs
- propertyentry.cs
- ProfileBuildProvider.cs
- FunctionMappingTranslator.cs
- StaticContext.cs
- TripleDES.cs
- FunctionCommandText.cs
- DbException.cs
- Viewport3DAutomationPeer.cs
- Span.cs
- FreezableOperations.cs
- UserControl.cs
- ProcessModelInfo.cs
- PackWebResponse.cs
- WindowsSecurityTokenAuthenticator.cs
- MsmqHostedTransportConfiguration.cs
- Stroke2.cs
- Substitution.cs
- MultiByteCodec.cs
- TextTreeTextElementNode.cs
- WindowsGraphicsCacheManager.cs
- DataProtection.cs
- DisplayInformation.cs
- SizeIndependentAnimationStorage.cs
- StopStoryboard.cs
- RoleGroup.cs
- DetailsViewUpdateEventArgs.cs
- WebPartVerb.cs
- XmlChoiceIdentifierAttribute.cs
- WebPartManager.cs
- MediaContext.cs
- WindowsIdentity.cs
- ConnectionsZoneAutoFormat.cs
- Border.cs
- CorrelationManager.cs
- ProfilePropertySettings.cs
- ArraySegment.cs
- VisualBasicSettings.cs
- ReadOnlyCollection.cs
- TranslateTransform3D.cs
- EnumUnknown.cs
- BufferBuilder.cs
- path.cs
- COM2TypeInfoProcessor.cs
- Directory.cs
- ConfigurationElement.cs
- StringUtil.cs
- LongSumAggregationOperator.cs
- datacache.cs
- SimpleType.cs
- SchemeSettingElement.cs
- FixedPage.cs
- TransactionFlowAttribute.cs
- Assembly.cs
- HwndSubclass.cs