ReusableResourceHolder<TResource> Structure

Visual Studio 2015
 

Holds a reference to a shared resource allocated by a ReusableResourceStoreBase and releases the resource back to the ReusableResourceStoreBase upon dispose.

Namespace:   Microsoft.VisualStudio.Utilities
Assembly:  Microsoft.VisualStudio.Utilities (in Microsoft.VisualStudio.Utilities.dll)

public struct ReusableResourceHolder<TResource> : IDisposable
where TResource : class

Type Parameters

TResource

The type of resource stored in the holder.

NameDescription
System_CAPS_pubpropertyResource

Gets the resource stored by this resource holder. After this object is disposed, returns null.

NameDescription
System_CAPS_pubmethodDispose()

Disposes of the resource, releasing it back to the ReusableResourceStore it came from.

System_CAPS_pubmethodEquals(Object)

(Inherited from ValueType.)

System_CAPS_pubmethodGetHashCode()

(Inherited from ValueType.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from ValueType.)

The type parameter must be a value type for ReusableResourceStore to be efficient. Using a reference type would require an allocation on each call, which would defeat the memory allocation savings of using ReusableResourceStore and ReusableResourceHolder in the first place.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: