共用方式為


ReusableResourceStore<TResource,TConstructorParameter>.Acquire Method

Definition

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

public:
 Microsoft::VisualStudio::Utilities::ReusableResourceHolder<TResource> Acquire(TConstructorParameter constructorParameter);
public Microsoft.VisualStudio.Utilities.ReusableResourceHolder<TResource> Acquire (TConstructorParameter constructorParameter);
member this.Acquire : 'ConstructorParameter -> Microsoft.VisualStudio.Utilities.ReusableResourceHolder<'Resource (requires 'Resource : null)>
Public Function Acquire (constructorParameter As TConstructorParameter) As ReusableResourceHolder(Of TResource)

Parameters

constructorParameter
TConstructorParameter

The parameter to pass when constructing the object.

Returns

A disposable object that should be disposed when usage of the resource is complete.

Applies to