Share via


_ItemLifeManager (Compact 2013)

3/28/2014

This class manages the lifetime of items in a data-source collection by providing functionality that adds and releases references to the items.

Syntax

class _ItemLifeManager 

Members

Methods

Methods

Description

_ItemLifeManager.CloneToBox(Obj *,XRValue *)

Provides a type-safe version of the _ItemLifeManager.CloneToBox(const Type&,XRValue *) method that returns an XRValue object that encapsulates the specified object.

_ItemLifeManager.CloneToBox(WCHAR *,XRValue *)

Returns an XRValue object that encapsulates the specified text string.

_ItemLifeManager.CloneToBox(const Type&,XRValue *)

Returns an XRValue object that encapsulates the specified Type object.

_ItemLifeManager.ReleaseItem(Obj *)

Releases resources that are allocated for an object that supports the IUnknown interface.

_ItemLifeManager.ReleaseItem(Type&)

Releases resources that are allocated for the specified item of type Type.

_ItemLifeManager.ReleaseItem(BSTR)

Releases resources that are allocated for the specified text string.

Thread Safety

Members of this class are not thread safe when you add, remove, update, or clear the objects in the collection. While you are updating objects with new data from the data provider, implement single threading and block other operations until the update is finished.

Remarks

The _ItemLifeManager class is the default value of the ItemLifeManager template parameter of _XRValueCollectionBaseT<IFace,ItemType,ItemComparer,ItemConverter,ItemLifeManager>. It provides the default functionality to add and release references to items in the collection.

To provide a custom implementation of methods that handle calling IUnknown::AddRef and IUnknown::Release for items in the collection, you can define your own class and set it as the value of the ItemLifeManager template parameter of _XRValueCollectionBaseT<IFace,ItemType,ItemComparer,ItemConverter,ItemLifeManager>.

Requirements

Header

XRCollection.h

See Also

Reference

Classes for Populating UI Elements with Data