XRObservableCollection.SetItemImpl(int,XRValue *) (Compact 2013)

3/28/2014

This protected method implements the collection operations for updating objects in the data source collection.

Syntax

HRESULT STDMETHODCALLTYPE SetItemImpl(
int nIndex,
XRValue * pValue)

Parameters

  • nIndex
    [in] Index of the XRValue object to update with the new object.
  • pValue
    [in] Pointer to the new XRValue object.

Return Value

The following table shows the possible return values.

Value

Description

S_OK

The method was successful.

E_FAIL

The method was unsuccessful.

E_BUSY

The collection is currently being updated.

E_OUTOFMEMORY

The method exceeded its available memory.

E_POINTER

The method cannot access the item to update.

The E_OUTOFMEMORY value is returned when the system does not have enough memory to create an internal instance of the collection object.

The E_OUTOFMEMORY and E_FAIL values are returned in two different situations:

  • E_OUTOFMEMORY is returned if the method was able to process the internal input parameter for the internal call to create an instance; however, the method was unable to create the instance by using the input parameter.
  • E_FAIL is returned by the method’s internal call to create an instance if none of its if statements were evaluated by the method. When E_FAIL is returned, none of the code in the internal call to create an instance was processed.

Remarks

The inherited method XRValueCollectionT.SetItem(int,const ItemType&) internally calls the SetItemImpl method to execute the functionality to update items in the collection. You can override the SetItemImpl method to provide a customized implementation for updating items in the collection.

Because XRObservableCollection.SetItemImpl is a protected member, an instance of XRObservableCollection<ItemType> cannot directly access the XRObservableCollection.SetItemImpl method.

If you derive a new class from XRObservableCollection<ItemType> that uses either public or protected access modifiers, you can override this method in the new class.

Requirements

Header

XRCollection.h

See Also

Reference

XRObservableCollection<ItemType>