I am looking for a framework-defined interface that declares indexer. In other words, I am looking for something like this:
public interface IYourList<T>
{
T this[int index] { get; set; }
}
I just wonder whether .Net framework contains such interface? If yes, what is it called?
You might ask why I can’t just create the interface myself. Well, I could have. But if .Net framework already has that why should I reinvent the wheel?
I think you’re looking for IList<T>.
Sample pasted from the MSDN site:
EDIT MORE:
This is the entire class I just Reflected to show you exactly how the interface is described in the framework: