ObjectCache.GetEnumerator ObjectCache.GetEnumerator ObjectCache.GetEnumerator ObjectCache.GetEnumerator Method

定义

在派生类中重写时,创建可用于循环访问缓存项的集合的枚举器。When overridden in a derived class, creates an enumerator that can be used to iterate through a collection of cache entries.

protected:
 abstract System::Collections::Generic::IEnumerator<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>> ^ GetEnumerator();
protected abstract System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string,object>> GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, obj>>
Protected MustOverride Function GetEnumerator () As IEnumerator(Of KeyValuePair(Of String, Object))

返回

可提供对缓存中的缓存项进行访问的枚举器对象。The enumerator object that provides access to the cache entries in the cache.

实现

注解

缓存实施者可以重写和扩展此方法, 以提供一种循环访问缓存条目集合的自定义方法。Cache implementers can override and extend this method to provide a custom means of iterating through a collection of cache entries.

备注

返回枚举器通常比返回整个缓存条目更昂贵。Returning an enumerator is typically a more expensive operation than returning the entire cache entry.

此方法由ObjectCacheGetEnumerator对和GetEnumerator方法的显式接口实现调用。This method is called by the explicit interface implementations that the ObjectCache class has for the GetEnumerator and GetEnumerator methods.

适用于