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
- MemoryFailPoint.cs
- Listbox.cs
- LookupBindingPropertiesAttribute.cs
- Size3D.cs
- SqlBuffer.cs
- Material.cs
- BitmapCacheBrush.cs
- FileDialogCustomPlace.cs
- RemoteAsymmetricSignatureFormatter.cs
- RSAPKCS1KeyExchangeFormatter.cs
- FunctionQuery.cs
- GeometryCombineModeValidation.cs
- documentsequencetextcontainer.cs
- MergeFailedEvent.cs
- ComplexLine.cs
- DbProviderFactory.cs
- ValidatorCompatibilityHelper.cs
- DisplayMemberTemplateSelector.cs
- GeneralTransform.cs
- TextBounds.cs
- XmlBoundElement.cs
- CqlLexer.cs
- nulltextnavigator.cs
- ScrollableControl.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- BamlBinaryReader.cs
- ProfessionalColorTable.cs
- VisualStyleInformation.cs
- ButtonBase.cs
- Stacktrace.cs
- DataControlCommands.cs
- WorkflowDesigner.cs
- DataGridTextBoxColumn.cs
- LineSegment.cs
- EmptyStringExpandableObjectConverter.cs
- DynamicMethod.cs
- WebZone.cs
- XsltContext.cs
- Attributes.cs
- ValidatorCompatibilityHelper.cs
- RegexGroupCollection.cs
- DbReferenceCollection.cs
- Update.cs
- OdbcErrorCollection.cs
- Serializer.cs
- LineGeometry.cs
- FileDialogCustomPlace.cs
- SimpleType.cs
- FixUpCollection.cs
- Soap.cs
- NavigationProperty.cs
- CheckBoxStandardAdapter.cs
- UIElementCollection.cs
- ConfigXmlComment.cs
- ValueTable.cs
- DefaultValueConverter.cs
- PointValueSerializer.cs
- QueryCursorEventArgs.cs
- LoadRetryHandler.cs
- GridItemProviderWrapper.cs
- DomNameTable.cs
- ComponentResourceKeyConverter.cs
- TypeResolver.cs
- Icon.cs
- TextRangeEditLists.cs
- Normalizer.cs
- CodeCatchClause.cs
- IdentifierCollection.cs
- GridViewUpdatedEventArgs.cs
- ThumbAutomationPeer.cs
- MediaCommands.cs
- Shared.cs
- WorkflowOwnershipException.cs
- SkewTransform.cs
- ColorBlend.cs
- WebHttpBinding.cs
- TextRangeBase.cs
- Timer.cs
- CatalogZoneBase.cs
- ToolStripSplitButton.cs
- AsymmetricAlgorithm.cs
- FeatureSupport.cs
- MenuItem.cs
- BaseComponentEditor.cs
- StoragePropertyMapping.cs
- CodeNamespaceImportCollection.cs
- ScaleTransform3D.cs
- MembershipPasswordException.cs
- CounterSet.cs
- InkCanvas.cs
- BindingNavigator.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- XmlLangPropertyAttribute.cs
- ModuleBuilderData.cs
- HMACSHA512.cs
- DataGridViewSelectedRowCollection.cs
- WebPartsPersonalization.cs
- IResourceProvider.cs
- UdpTransportSettings.cs
- EditorPart.cs