正如loki指出的,IEnumerator<T>
是一个接口,而不是一个具体的类,所以没有实现。但是,你可以四处搜寻了一下,找到一个an example of how to implement the interface for your custom type(s).
要回答你的问题直接,它在mscorlib.dll定义,这是整个.NET 4.0文件:
#region Assembly mscorlib.dll, v4.0.30319
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll
#endregion
using System;
using System.Collections;
namespace System.Collections.Generic
{
// Summary:
// Supports a simple iteration over a generic collection.
//
// Type parameters:
// T:
// The type of objects to enumerate.This type parameter is covariant. That is,
// you can use either the type you specified or any type that is more derived.
// For more information about covariance and contravariance, see Covariance
// and Contravariance in Generics.
public interface IEnumerator<out T> : IDisposable, IEnumerator
{
// Summary:
// Gets the element in the collection at the current position of the enumerator.
//
// Returns:
// The element in the collection at the current position of the enumerator.
T Current { get; }
}
}
loki2302是完全正确的。也许你可以编辑你的问题,以便我们可以帮助你解决实际问题。既然它是一个接口,你必须知道实际的实现(就像String.GetEnumerator()它是CharEnumerator类)。 –
你在找什么?你有一个类似.Net Reflector的反编译器吗? –