Re: CodeDom foreach
- From: "Ben Voigt" <rbv@xxxxxxxxxxxxx>
- Date: Thu, 11 Jan 2007 13:24:48 -0600
"Kevin Burton" <KevinBurton@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F3B3C9DE-D7DA-4819-9365-760375492ECD@xxxxxxxxxxxxxxxx
Sorry, one more question. Given a Type how do I tell if IEnumerable or
IEnumerate is supported? Then from the Type how do I get the Type that
IEnumerate would return? In other words what is the Type of the Current
method?
Type.GetInterfaces()
then check each against System.Collections.IEnumerable,
System.Collections.IEnumerator, System.Collections.Generic.IEnumerable<T>,
and System.Collections.Generic.IEnumerator<T>.
If either of the generic interfaces are implemented, you can get the type
returned during enumeration using Type.GetGenericArguments() on the
interface in question. If only one of the System.Collections interfaces is
listed, the enumerator gives objects.
Thank you.
"Mubashir Khan" wrote:
.
- References:
- Re: CodeDom foreach
- From: Mubashir Khan
- Re: CodeDom foreach
- Prev by Date: Re: GDI+ moving drawings
- Next by Date: Re: .Net 3.0 Install Error
- Previous by thread: Re: CodeDom foreach
- Next by thread: Error reading the HTTPListenerRequest InputStream
- Index(es):
Relevant Pages
|