المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Arrays and the interfaces they implement.



C# Programming
11-08-2009, 09:30 PM
The System.Array class implements several interfaces such as IList, IEnumberable, and so on. However, when defining an array of specific types such as string[] or Foo[] I have noticed those implement the generic versions of IList and IEnumerable.

I am at a loss where this is defined. For instance, I know that arrays are reference type object derived from System.Array, however looking at the IL I see no formal implementation of this.

It would be really nice if the SDK documentation would fill me in on these details, particularly the interfaces that are implemented. I have not seen where IList and IEnumerable are tagged on to System.Array and there is no System.Array.

How am I supposed to know that string[] implements IList and IEnumerable if it isn't documented?

Watch the Fall of the Republic (High Quality 2:24:19) (http://tiny.cc/rZdDq)[^ (http://tiny.cc/rZdDq)]