SimpleList.Item Property (BCL)
[Visual Basic .NET] The Item property is a read/write Object that contains an element of the SimpleList object. An initialized Object is stored at a specified array index. If an item is already stored at the specified index, then that item is overwritten by an assignment.
[C#] The Item indexer provides get or set access to an element of the SimpleList object. If an item is already stored at the specified index, that item is overwritten when setting a value.
Definition
[Visual Basic .NET]
Public Property Item(Index As Integer) As Object
[C#]
Get method:
public object this[ int Index ] [get; set;]
Parameters
[Visual Basic .NET]
- Index
An Integer value that contains the index of the item.
[C#]
- Index
An Integer that contains the index of the item.
Return Values
[C#]
The get version of the indexer returns an object containing the value present at the location specified by the Index parameter.
Exceptions
This indexer may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.
The following table shows the custom COM error codes that may be present in any exception thrown.
Constant | Description |
---|---|
DISP_E_BADINDEX | The Index parameter references an out-of-range value. This means that Index contains a value either larger than the SimpleList object or less than zero. |
[Visual Basic .NET]
Example
' using Item property as a property...
oSimpleList.Item(5) = "Winnie The Pooh"
' using Item property as an indexer...
oSimpleList(5) = "Winnie The Pooh"
Requirements
Namespace: Microsoft.CommerceServer.Runtime
Platforms: Windows 2000, Windows Server 2003
Assembly: mscscorelib (in mscscorelib.dll)
See Also
Copyright © 2005 Microsoft Corporation.
All rights reserved.