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
- RequestQueue.cs
- CriticalExceptions.cs
- Int64AnimationUsingKeyFrames.cs
- EventMappingSettingsCollection.cs
- Environment.cs
- TdsParameterSetter.cs
- SemaphoreFullException.cs
- XsdDuration.cs
- ObjectDataSource.cs
- RepeatInfo.cs
- DbConnectionClosed.cs
- OdbcException.cs
- RestClientProxyHandler.cs
- LogEntry.cs
- WebControlToolBoxItem.cs
- StylusDevice.cs
- Compilation.cs
- LabelLiteral.cs
- BooleanProjectedSlot.cs
- SecurityKeyIdentifier.cs
- DataDocumentXPathNavigator.cs
- OutputCacheModule.cs
- ElementUtil.cs
- MembershipSection.cs
- QilInvoke.cs
- KnownBoxes.cs
- DbgUtil.cs
- ColorConvertedBitmapExtension.cs
- Expression.DebuggerProxy.cs
- FormatterServicesNoSerializableCheck.cs
- Win32MouseDevice.cs
- Calendar.cs
- CriticalFinalizerObject.cs
- SerializationInfo.cs
- RelationshipFixer.cs
- CellTreeNode.cs
- DependencyObjectType.cs
- DataSourceView.cs
- StreamReader.cs
- CultureTableRecord.cs
- Renderer.cs
- PenThread.cs
- NetworkInformationException.cs
- ValidateNames.cs
- TypeInformation.cs
- DataBoundLiteralControl.cs
- BaseDataListDesigner.cs
- BaseResourcesBuildProvider.cs
- EntitySet.cs
- AnimationLayer.cs
- BamlCollectionHolder.cs
- WebPartVerb.cs
- DashStyle.cs
- OraclePermissionAttribute.cs
- ObjectDataSourceMethodEventArgs.cs
- EntityDataSourceStatementEditor.cs
- SystemWebSectionGroup.cs
- BitmapEffectOutputConnector.cs
- _AutoWebProxyScriptEngine.cs
- QuotedPrintableStream.cs
- InputReportEventArgs.cs
- MeasurementDCInfo.cs
- DispatcherFrame.cs
- SqlGatherProducedAliases.cs
- MenuAutomationPeer.cs
- DataGridViewComboBoxEditingControl.cs
- RuntimeResourceSet.cs
- VisualStateGroup.cs
- ImageInfo.cs
- SqlDataSourceQueryEditor.cs
- CodeTypeParameterCollection.cs
- WindowsComboBox.cs
- ProcessStartInfo.cs
- DetailsViewPageEventArgs.cs
- PauseStoryboard.cs
- CoreSwitches.cs
- GradientBrush.cs
- TableParagraph.cs
- BypassElementCollection.cs
- DetailsViewCommandEventArgs.cs
- ResourceExpressionBuilder.cs
- GeneralTransform3DCollection.cs
- SubtreeProcessor.cs
- PathFigureCollectionConverter.cs
- LinkConverter.cs
- TextMetrics.cs
- Transform.cs
- XPathDocumentBuilder.cs
- TextServicesProperty.cs
- CursorConverter.cs
- ListBoxItemAutomationPeer.cs
- webeventbuffer.cs
- DataKey.cs
- SpecialNameAttribute.cs
- WindowsBrush.cs
- VariantWrapper.cs
- WebPartAddingEventArgs.cs
- BitmapSourceSafeMILHandle.cs
- StyleBamlTreeBuilder.cs
- UriScheme.cs