-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
ienumerable.cs
51 lines (49 loc) · 1.48 KB
/
ienumerable.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** Interface: IEnumerable
**
** <OWNER>kimhamil</OWNER>
**
**
** 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.
#if CONTRACTS_FULL
[ContractClass(typeof(IEnumerableContract))]
#endif // CONTRACTS_FULL
[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();
}
#if CONTRACTS_FULL
[ContractClassFor(typeof(IEnumerable))]
internal abstract class IEnumerableContract : IEnumerable
{
[Pure]
IEnumerator IEnumerable.GetEnumerator()
{
Contract.Ensures(Contract.Result<IEnumerator>() != null);
return default(IEnumerator);
}
}
#endif // CONTRACTS_FULL
}