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
- XmlNotation.cs
- FragmentNavigationEventArgs.cs
- DoubleCollectionConverter.cs
- ByteStream.cs
- StateItem.cs
- NullableDoubleSumAggregationOperator.cs
- WinFormsComponentEditor.cs
- DataTableTypeConverter.cs
- BCryptSafeHandles.cs
- XhtmlConformanceSection.cs
- WizardPanel.cs
- ReferencedType.cs
- ObjectDisposedException.cs
- DbConnectionStringBuilder.cs
- KnownBoxes.cs
- EventDescriptor.cs
- ProxyWebPartManager.cs
- FieldBuilder.cs
- Set.cs
- TimeSpanValidatorAttribute.cs
- ItemCheckedEvent.cs
- OSFeature.cs
- RowVisual.cs
- TableLayoutStyle.cs
- SchemaManager.cs
- FilterableAttribute.cs
- BeginCreateSecurityTokenRequest.cs
- RawStylusInput.cs
- SqlUnionizer.cs
- EventHandlerService.cs
- Span.cs
- NamedElement.cs
- HtmlInputText.cs
- PingReply.cs
- LineServices.cs
- FlowDocumentScrollViewer.cs
- XslVisitor.cs
- XmlSchemaObject.cs
- XdrBuilder.cs
- CollectionViewGroupInternal.cs
- SizeF.cs
- InkCollectionBehavior.cs
- ToolStripOverflowButton.cs
- DbConnectionStringBuilder.cs
- AppDomainInfo.cs
- X500Name.cs
- ActiveDocumentEvent.cs
- ApplicationHost.cs
- CultureSpecificStringDictionary.cs
- Utils.cs
- CodeChecksumPragma.cs
- RootAction.cs
- DataGridViewRow.cs
- SoapSchemaMember.cs
- ProtocolsConfiguration.cs
- TrustManagerPromptUI.cs
- XmlExceptionHelper.cs
- MenuItemStyle.cs
- DesignOnlyAttribute.cs
- SevenBitStream.cs
- FactoryId.cs
- ToolboxItemCollection.cs
- CoTaskMemHandle.cs
- GeneralTransform.cs
- Crc32.cs
- UTF8Encoding.cs
- NetStream.cs
- BitFlagsGenerator.cs
- HtmlControlDesigner.cs
- ParameterReplacerVisitor.cs
- _StreamFramer.cs
- PostBackTrigger.cs
- ObjectKeyFrameCollection.cs
- FormatConvertedBitmap.cs
- TextEditorThreadLocalStore.cs
- FileEnumerator.cs
- RegistrationServices.cs
- SqlGenericUtil.cs
- SmtpNegotiateAuthenticationModule.cs
- RuleRefElement.cs
- OrderedDictionary.cs
- WindowsMenu.cs
- TrustManagerPromptUI.cs
- SqlDataSourceEnumerator.cs
- FontWeight.cs
- AuthenticationManager.cs
- DispatchWrapper.cs
- CustomBinding.cs
- Serializer.cs
- XmlSchemaExternal.cs
- mediaeventshelper.cs
- MachineKeySection.cs
- ResourceProviderFactory.cs
- Misc.cs
- WindowInteropHelper.cs
- GraphicsContainer.cs
- RichTextBox.cs
- OleDbCommandBuilder.cs
- StringBuilder.cs
- ErrorFormatter.cs