Freigeben über


ReusableResourceStore<TResource> Class

Definition

Stores a resource that requires no constructor parameters for instantiation. See ReusableResourceStoreBase for more information.

generic <typename TResource>
 where TResource : classpublic ref class ReusableResourceStore abstract : Microsoft::VisualStudio::Utilities::ReusableResourceStoreBase<TResource>
public abstract class ReusableResourceStore<TResource> : Microsoft.VisualStudio.Utilities.ReusableResourceStoreBase<TResource> where TResource : class
type ReusableResourceStore<'Resource (requires 'Resource : null)> = class
    inherit ReusableResourceStoreBase<'Resource (requires 'Resource : null)>
Public MustInherit Class ReusableResourceStore(Of TResource)
Inherits ReusableResourceStoreBase(Of TResource)

Type Parameters

TResource

The type of resource to store.

Inheritance
ReusableResourceStore<TResource>

Constructors

ReusableResourceStore<TResource>()

Methods

Acquire()

Acquires a cached instance of the resource, or allocates a new instance if none are currently available.

AcquireCore()

Gets access to the resource stored by this object, and removes the resource so that subsequent callers cannot be handed the same resource at the same time.

(Inherited from ReusableResourceStoreBase<TResource>)
Allocate()

Allocates a new instance of the resource when one is not available in the cache.

CanReuse(TResource)

Validates that an already-cached resource value is safe to reuse when Acquire is called.

Cleanup(TResource)

Immediately before releasing an object, performs cleanup on that object. This might be necessary to clean up state stored in the object to prevent leaking memory.

(Inherited from ReusableResourceStoreBase<TResource>)

Applies to