DicomObjects Reference
DicomObjects Reference / DicomContexts Collection / Item Property
The ID of the context being accessed
In This Topic
    Item Property
    In This Topic
    Description
    Provides access to the members of a DicomContexts collection
    Property type
    Read-only property
    Syntax
    Visual Basic
    Public Property Item( _
       ByVal ContextID As Integer _
    ) As DicomContext
    Parameters
    ContextID
    The ID of the context being accessed
    Example

    As it is a presentation context ID, the index must be a small, odd integer (1-255)
    As items may be missing or rejected from the sequence, the best way to access all the members of a DicomContexts collection is using the standard iterator (for each in VB).  In languages where this is not available then the Exists property must be tested, and the best method is along the lines:

    Copy Code
    for i=1 to 255 step 2
    if contexts.exists(i) then
       context = contexts(i)
       process context item…
      end if
    next
    spacer_300be30a-de70-48d1-8002-66a2e2ac7187

    As this is the default property, the term "Item" is rarely used, as

    Contexts.Item(3)

    may rather more concisely be written as

    Contexts(3)

    See Also