> I find this very odd. I'm using GetEnumerator from the my HttpRuntime
> cache, and I'm trying to cast the result to a Dictionary(Of String, Object)
[quoted text clipped - 3 lines]
> But I can't find the AggregateEnumerator class anywhere. What's going on
> here?

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
I tried it because the Cache.GetEnumerator method returns
IDictionaryEnumerator, and the Dictionary(Of TKey, TValue) uses that
interface.
I'm not worried about that, what I'm really trying to do is get the Cache
items in a class that I can DataBind without going looping through an
enumeration manually... so I'm trying a number of things. But I'm confused
about not being able to find the AggregateEnumerator class in the Object
Browser, or being able to declare a variable as AggregateEnumerator. It's
as though it doesn't really exist.
>> I find this very odd. I'm using GetEnumerator from the my HttpRuntime
>> cache, and I'm trying to cast the result to a Dictionary(Of String,
[quoted text clipped - 7 lines]
> The result of calling GetEnumerator os the AggregateEnumerator. Why did
> you think you'd be able to cast it to a Dictionary(Of String, Object)?
Jon Skeet [C# MVP] - 18 Jul 2007 19:44 GMT
> I tried it because the Cache.GetEnumerator method returns
> IDictionaryEnumerator, and the Dictionary(Of TKey, TValue) uses that
> interface.
When a method's return type is an interface, you should try to just use
the interface, rather than assuming a particular implementation. Even
if it had worked right now, there's nothing to say it would still work
with a future version of .NET.
> I'm not worried about that, what I'm really trying to do is get the Cache
> items in a class that I can DataBind without going looping through an
> enumeration manually... so I'm trying a number of things. But I'm confused
> about not being able to find the AggregateEnumerator class in the Object
> Browser, or being able to declare a variable as AggregateEnumerator. It's
> as though it doesn't really exist.
No, it's just an internal type - an implementation detail which
implements a public interface.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too