Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Collections / IEnumerable.cs / 1305376 / IEnumerable.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** Interface: IEnumerable
**
** [....]
**
**
** Purpose: Interface for classes providing IEnumerators
**
**
===========================================================*/
namespace System.Collections {
using System;
using System.Diagnostics.Contracts;
using System.Runtime.InteropServices;
// Implement this interface if you need to support VB's foreach semantics.
// Also, COM classes that support an enumerator will also implement this interface.
[ContractClass(typeof(IEnumerableContract))]
[Guid("496B0ABE-CDEE-11d3-88E8-00902754C43A")]
[System.Runtime.InteropServices.ComVisible(true)]
public interface IEnumerable
{
// Interfaces are not serializable
// Returns an IEnumerator for this enumerable Object. The enumerator provides
// a simple way to access all the contents of a collection.
[Pure]
[DispId(-4)]
IEnumerator GetEnumerator();
}
[ContractClassFor(typeof(IEnumerable))]
internal class 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 classes providing IEnumerators
**
**
===========================================================*/
namespace System.Collections {
using System;
using System.Diagnostics.Contracts;
using System.Runtime.InteropServices;
// Implement this interface if you need to support VB's foreach semantics.
// Also, COM classes that support an enumerator will also implement this interface.
[ContractClass(typeof(IEnumerableContract))]
[Guid("496B0ABE-CDEE-11d3-88E8-00902754C43A")]
[System.Runtime.InteropServices.ComVisible(true)]
public interface IEnumerable
{
// Interfaces are not serializable
// Returns an IEnumerator for this enumerable Object. The enumerator provides
// a simple way to access all the contents of a collection.
[Pure]
[DispId(-4)]
IEnumerator GetEnumerator();
}
[ContractClassFor(typeof(IEnumerable))]
internal class 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
- MonthCalendarDesigner.cs
- ObjectConverter.cs
- InputScopeNameConverter.cs
- ExceptionWrapper.cs
- CompiledRegexRunnerFactory.cs
- VarInfo.cs
- __Filters.cs
- RenderingEventArgs.cs
- Identity.cs
- StorageFunctionMapping.cs
- RecommendedAsConfigurableAttribute.cs
- BuildManagerHost.cs
- PeerResolverMode.cs
- StandardCommands.cs
- FreezableOperations.cs
- ArraySet.cs
- StrokeRenderer.cs
- AttributeUsageAttribute.cs
- InlinedAggregationOperatorEnumerator.cs
- HttpServerUtilityBase.cs
- ConnectionStringSettings.cs
- DataRowView.cs
- FormsAuthenticationUserCollection.cs
- WindowsTitleBar.cs
- Cloud.cs
- Rotation3DAnimationBase.cs
- Section.cs
- AnimatedTypeHelpers.cs
- PrivateFontCollection.cs
- DifferencingCollection.cs
- EndCreateSecurityTokenRequest.cs
- ReliableMessagingHelpers.cs
- DrawingImage.cs
- CornerRadiusConverter.cs
- RadioButton.cs
- ArraySegment.cs
- OleCmdHelper.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- DataRowChangeEvent.cs
- Block.cs
- DataGridViewLinkColumn.cs
- Help.cs
- SqlVersion.cs
- EffectiveValueEntry.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ChtmlMobileTextWriter.cs
- ModuleBuilderData.cs
- RuntimeIdentifierPropertyAttribute.cs
- DataGridView.cs
- MiniCustomAttributeInfo.cs
- MachineKeySection.cs
- SessionSwitchEventArgs.cs
- Function.cs
- ResourcesBuildProvider.cs
- DataGridViewButtonColumn.cs
- ListViewSortEventArgs.cs
- TextChangedEventArgs.cs
- OleDbRowUpdatingEvent.cs
- ReservationNotFoundException.cs
- ScriptingWebServicesSectionGroup.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- xmlsaver.cs
- TreeNodeCollection.cs
- isolationinterop.cs
- Aggregates.cs
- DirectoryNotFoundException.cs
- objectresult_tresulttype.cs
- TextServicesManager.cs
- InProcStateClientManager.cs
- ThemeDirectoryCompiler.cs
- SimplePropertyEntry.cs
- GenericRootAutomationPeer.cs
- JsonEncodingStreamWrapper.cs
- ClientUtils.cs
- PreloadedPackages.cs
- TimelineGroup.cs
- OutKeywords.cs
- XmlSortKey.cs
- CollectionChange.cs
- BamlReader.cs
- TakeOrSkipWhileQueryOperator.cs
- MetadataExporter.cs
- GlobalAllocSafeHandle.cs
- ErrorFormatterPage.cs
- InputMethodStateTypeInfo.cs
- Directory.cs
- DataServiceStreamResponse.cs
- HttpChannelBindingToken.cs
- ConfigurationLockCollection.cs
- StringHandle.cs
- HttpApplicationFactory.cs
- HelloOperation11AsyncResult.cs
- SymDocumentType.cs
- SafeFindHandle.cs
- AncestorChangedEventArgs.cs
- RecordsAffectedEventArgs.cs
- WebRequestModuleElement.cs
- Int32Converter.cs
- AppSettingsReader.cs
- CodeDesigner.cs