DtoSelectionItems Collection
A collection of DtoSelectionItem objects representing the possible values of a selection type setting.
Properties
Methods
Add method
GetById method
Remove method
Remarks
The property AllPossibleSelections of object DtoSetting Object returns the DtoSelectionItems collection.
Use the Count property to find the number of members in the collection.
Example
Set first_setting = my_settings(1)
 
type = first_setting.Type
 
’ only call this for selection type settings
’ see Setting Type enumeration
’ for a list of setting types
 
if (type = dtoSingleSel) OR (type = dtoMultiSel)
Set all_the_selections = first_setting.AllPossibleSelections
See Also
DtoCategories Collection
DtoSetting Object
Methods Detail
Add method
Add an item to a DtoSelectionItems collection.
Syntax
result = Collection.Add(Object)
Arguments
Return Values
Remarks
This method takes a parameter of type DtoSelectionItem. Therefore, you are responsible for first instantiating the object and setting its properties before adding it to the collection.
Example
Dim Result As dtoResult
Dim Session As New DtoSession
Result = Session.Connect("nik-ntws", "", "")
Dim my_setting As DtoSetting
Dim SetID As Long
SetID = 26
Set my_setting = Session.GetSetting(SetID)
If my_setting Is Nothing Then
MsgBox " Setting is wrong"
Exit Sub
End If
 
' Start to assign new values:
'Add Items with ItemID 1,2 and 12
new_selections.Add my_setting.AllPossibleSelections.Item(2)
'Microsoft SPXII
new_selections.Add my_setting.AllPossibleSelections.Item(4)
'Microsoft IPX
new_selections.Add my_setting.AllPossibleSelections.Item(12) 'Microsoft NETBIOS
 
my_setting.Value = new_selections
GetById method
Returns a DtoSelectionItem object from a DtoSelectionItems collection given an id.
Syntax
my_selection_item = Collection.GetById(id)
Arguments
Return Values
DtoSelectionItem Object corresponding to id.
Example
Dim Result As DtoResult
Dim Session As New DtoSession
Result = Session.Connect("nik-ntws", "", "")
Dim my_setting As DtoSetting
Dim SetID As Long
SetID = 26
Set my_setting = Session.GetSetting(SetID)
If my_setting Is Nothing Then
MsgBox " Setting is wrong"
Exit Sub
End If
 
Dim new_selections As New DtoSelectionItems
new_selections.Add my_setting.AllPossibleSelections.GetByID(1) 'Microsoft SPXII
new_selections.Add my_setting.AllPossibleSelections.GetByID(3) 'Microsoft TCP/IP
new_selections.Add my_setting.AllPossibleSelections.GetByID(11) 'Microsoft NETBIOS
 
my_setting.Value = new_selections
Remove method
Removes an item from a DtoSelectionItems collection
Syntax
result = Collection.Remove(item)
Arguments
Return Values
Remarks
This method takes a parameter of type DtoSelectionItem
Example
Dim Result As DtoResult
Dim Session As New DtoSession
Result = Session.Connect("nik-ntws", "", "")
Dim my_setting As DtoSetting
Dim SetID As Long
SetID = 26
Set my_setting = Session.GetSetting(SetID)
If my_setting Is Nothing Then
MsgBox " Setting is wrong"
Exit Sub
End If
 
Dim new_selections As New DtoSelectionItems
new_selections.Add my_setting.AllPossibleSelections.GetByID(1) 'Microsoft SPXII
new_selections.Remove(1)
 
my_setting.Value = new_selections