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
- ContourSegment.cs
- QilLoop.cs
- MessageQueueInstaller.cs
- MessageFormatterConverter.cs
- BaseParaClient.cs
- Variant.cs
- WebZone.cs
- BaseProcessor.cs
- CodeParameterDeclarationExpressionCollection.cs
- Error.cs
- StrongName.cs
- FloatMinMaxAggregationOperator.cs
- TextStore.cs
- PartialCachingAttribute.cs
- AutomationFocusChangedEventArgs.cs
- X509RecipientCertificateClientElement.cs
- SerializationException.cs
- KeyPullup.cs
- SharedStatics.cs
- EntityCommandCompilationException.cs
- EventLog.cs
- RowBinding.cs
- SmtpCommands.cs
- ConstantProjectedSlot.cs
- sqlcontext.cs
- Win32Exception.cs
- NavigationProperty.cs
- XmlSchemaInferenceException.cs
- PkcsMisc.cs
- safelinkcollection.cs
- XmlHierarchicalEnumerable.cs
- TypeContext.cs
- ProcessManager.cs
- WebEventCodes.cs
- AmbientValueAttribute.cs
- Parameter.cs
- ThreadInterruptedException.cs
- RepeaterDesigner.cs
- SafeLibraryHandle.cs
- RelatedPropertyManager.cs
- Pts.cs
- EditorPart.cs
- Viewport3DAutomationPeer.cs
- PropertyDescriptorCollection.cs
- InnerItemCollectionView.cs
- WebBrowserNavigatedEventHandler.cs
- HtmlInputText.cs
- SignatureDescription.cs
- FlatButtonAppearance.cs
- ResourceWriter.cs
- DataGridViewCellMouseEventArgs.cs
- StrokeIntersection.cs
- ColorIndependentAnimationStorage.cs
- AssemblyCache.cs
- DrawingCollection.cs
- HttpContext.cs
- DescendantBaseQuery.cs
- ChannelDispatcher.cs
- DependencyPropertyAttribute.cs
- IteratorFilter.cs
- BindableTemplateBuilder.cs
- BinHexDecoder.cs
- ServiceOperationParameter.cs
- UTF7Encoding.cs
- DecoderNLS.cs
- ColumnMapCopier.cs
- RegexCompiler.cs
- SoundPlayer.cs
- InputScopeNameConverter.cs
- WebPartRestoreVerb.cs
- SQLByteStorage.cs
- SolidColorBrush.cs
- KeyManager.cs
- MethodToken.cs
- FontFamily.cs
- OlePropertyStructs.cs
- ResourcesGenerator.cs
- NamespaceTable.cs
- QilDataSource.cs
- COM2PictureConverter.cs
- TdsParserSafeHandles.cs
- AutoGeneratedFieldProperties.cs
- OrderedEnumerableRowCollection.cs
- ArrangedElementCollection.cs
- RenamedEventArgs.cs
- ParserContext.cs
- TableItemProviderWrapper.cs
- SiteMapDataSource.cs
- GeometryDrawing.cs
- CriticalFinalizerObject.cs
- DataGridColumnHeadersPresenter.cs
- EnumMemberAttribute.cs
- ResourceProviderFactory.cs
- LinqDataSourceContextData.cs
- VarRemapper.cs
- XsdBuilder.cs
- ProxyWebPart.cs
- RNGCryptoServiceProvider.cs
- ValueHandle.cs
- SendMailErrorEventArgs.cs