正如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的反編譯器嗎? –