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
- TableItemStyle.cs
- DSASignatureDeformatter.cs
- MgmtConfigurationRecord.cs
- SystemKeyConverter.cs
- CharConverter.cs
- LayoutEditorPart.cs
- PageContentAsyncResult.cs
- ToolStripDesigner.cs
- OperationAbortedException.cs
- UpWmlMobileTextWriter.cs
- EventLogEntry.cs
- ErrorStyle.cs
- OrderedDictionary.cs
- BreakRecordTable.cs
- EntityTransaction.cs
- PartialClassGenerationTaskInternal.cs
- SelectionHighlightInfo.cs
- StrokeDescriptor.cs
- CollectionChangeEventArgs.cs
- WebColorConverter.cs
- MouseDevice.cs
- UdpDiscoveryEndpointElement.cs
- JsonMessageEncoderFactory.cs
- URL.cs
- ValidationPropertyAttribute.cs
- VariantWrapper.cs
- WindowsFont.cs
- InstanceStoreQueryResult.cs
- RelationshipConverter.cs
- DataServiceQueryOfT.cs
- xamlnodes.cs
- LZCodec.cs
- ListBindingHelper.cs
- Matrix.cs
- MessageQueueException.cs
- EntityDataSourceSelectingEventArgs.cs
- HwndPanningFeedback.cs
- CodeObjectCreateExpression.cs
- WindowsRichEdit.cs
- UnauthorizedWebPart.cs
- DatePickerAutomationPeer.cs
- WebConfigurationHostFileChange.cs
- RawTextInputReport.cs
- DateBoldEvent.cs
- Update.cs
- GridErrorDlg.cs
- HandleRef.cs
- XmlCharacterData.cs
- LayoutSettings.cs
- DiscoveryMessageProperty.cs
- SqlRowUpdatingEvent.cs
- DmlSqlGenerator.cs
- Msmq.cs
- StreamGeometryContext.cs
- NamedPipeWorkerProcess.cs
- EncryptedType.cs
- SecurityKeyType.cs
- XmlQuerySequence.cs
- RealProxy.cs
- IsolatedStorageFileStream.cs
- MultiDataTrigger.cs
- DataServiceQueryException.cs
- ErrorTableItemStyle.cs
- AmbientProperties.cs
- Function.cs
- NotificationContext.cs
- AuthenticationSection.cs
- TaskResultSetter.cs
- TabItemWrapperAutomationPeer.cs
- SymLanguageType.cs
- Task.cs
- CommonDialog.cs
- WebPartTransformerAttribute.cs
- DataGridHeaderBorder.cs
- BuildProvidersCompiler.cs
- WrappedReader.cs
- JsonQNameDataContract.cs
- DocumentEventArgs.cs
- ToolStripSeparatorRenderEventArgs.cs
- PostBackTrigger.cs
- SelectionPatternIdentifiers.cs
- MarkupObject.cs
- XmlSchemaImport.cs
- SoundPlayerAction.cs
- AutoResetEvent.cs
- HostUtils.cs
- GridViewRowCollection.cs
- TreeNodeClickEventArgs.cs
- TextTreeExtractElementUndoUnit.cs
- DecimalAnimation.cs
- QueryContinueDragEvent.cs
- Enlistment.cs
- FixedPageStructure.cs
- COM2ExtendedBrowsingHandler.cs
- XmlAttributeProperties.cs
- PeerToPeerException.cs
- SqlUserDefinedAggregateAttribute.cs
- TemplateControlParser.cs
- WebPartConnectionsCloseVerb.cs
- ProcessModuleCollection.cs