Share via


Remove Method (Int32)

Removes the LineItem at the specified index from the current collection.

Namespace:  Microsoft.CommerceServer.Runtime.Orders
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Sub Remove ( _
    index As Integer _
)
'Usage
Dim instance As LineItemCollection
Dim index As Integer

instance.Remove(index)
public void Remove(
    int index
)
public:
void Remove(
    int index
)
public function Remove(
    index : int
)

Parameters

Exceptions

Exception Condition
ArgumentOutOfRangeException

index is out of range of the current collection.

Remarks

Removes a specified LineItem from the collection. When a LineItem is removed from the collection, all subsequent LineItem objects move up one index in the collection and the collection count is decremented.

If there are no line items in the collection, the function returns with no exception.

When this operation is performed, the LastModified property is updated. LastModified is not updated when there are no line items or an exception is thrown.

Remove also updates the Index property for all the remaining line items and places them accordingly in the line item collection.

Permissions

See Also

Reference

LineItemCollection Class

LineItemCollection Members

Remove Overload

Microsoft.CommerceServer.Runtime.Orders Namespace