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
- WebScriptClientGenerator.cs
- RowToParametersTransformer.cs
- SourceItem.cs
- TransformerInfo.cs
- ItemMap.cs
- arabicshape.cs
- RowBinding.cs
- BooleanProjectedSlot.cs
- CompilerHelpers.cs
- DelimitedListTraceListener.cs
- UnsafeNativeMethods.cs
- PropertyChangedEventManager.cs
- ParseChildrenAsPropertiesAttribute.cs
- LabelAutomationPeer.cs
- VisualProxy.cs
- GridViewRowPresenterBase.cs
- WebServiceMethodData.cs
- ToolBarPanel.cs
- _ListenerRequestStream.cs
- ByteKeyFrameCollection.cs
- ParallelQuery.cs
- WindowsListViewSubItem.cs
- HttpEncoder.cs
- TakeOrSkipWhileQueryOperator.cs
- ItemList.cs
- ClientSession.cs
- InitializingNewItemEventArgs.cs
- PeekCompletedEventArgs.cs
- OleDbError.cs
- KoreanLunisolarCalendar.cs
- COAUTHIDENTITY.cs
- DrawItemEvent.cs
- ILGenerator.cs
- FontNamesConverter.cs
- Content.cs
- EllipticalNodeOperations.cs
- UTF32Encoding.cs
- ConfigurationManagerHelperFactory.cs
- NetworkCredential.cs
- Rectangle.cs
- MessageBox.cs
- MULTI_QI.cs
- DataControlCommands.cs
- WebPartChrome.cs
- HttpCacheVaryByContentEncodings.cs
- PropertyPathWorker.cs
- PropertyGridCommands.cs
- XmlSchemaIdentityConstraint.cs
- MappingModelBuildProvider.cs
- LogSwitch.cs
- GiveFeedbackEvent.cs
- OptionUsage.cs
- SortKey.cs
- TextServicesPropertyRanges.cs
- EntityViewGenerationAttribute.cs
- ExtenderControl.cs
- WebPartDescription.cs
- DataRowComparer.cs
- XComponentModel.cs
- PropertyDescriptorComparer.cs
- OdbcConnectionStringbuilder.cs
- Vector3DCollection.cs
- TargetInvocationException.cs
- DescendentsWalkerBase.cs
- PageCatalogPart.cs
- RSAPKCS1SignatureDeformatter.cs
- Panel.cs
- TreeNode.cs
- UrlMappingCollection.cs
- InternalDuplexChannelFactory.cs
- ScriptComponentDescriptor.cs
- BinaryCommonClasses.cs
- StringBlob.cs
- RemoveStoryboard.cs
- InputMethodStateTypeInfo.cs
- MarkupProperty.cs
- ExternalException.cs
- assemblycache.cs
- SiteMapNodeCollection.cs
- CurrencyWrapper.cs
- ColumnResizeUndoUnit.cs
- BinaryReader.cs
- Pen.cs
- KeyEventArgs.cs
- Base64Encoder.cs
- PageRequestManager.cs
- Brush.cs
- EntityDataSourceContextCreatedEventArgs.cs
- Ray3DHitTestResult.cs
- PropertyAccessVisitor.cs
- FullTextState.cs
- arc.cs
- ToolStripContentPanel.cs
- XmlSchemaChoice.cs
- ResourceManager.cs
- Update.cs
- Inline.cs
- QueryCacheKey.cs
- MultilineStringEditor.cs
- _LocalDataStoreMgr.cs