Distributed Tuning Objects Guide (v11)

DtoSelectionItems コレクション

選択タイプの設定で、選択可能な値を表す DtoSelectionItem オブジェクトのコレクション。

プロパティ

Count
コレクション内のメンバー数を返します。
Item
コレクションの特定のメンバーを返します。

メソッド

Add メソッド

GetById メソッド

Remove メソッド

備考

DtoSetting オブジェクトAllPossibleSelections プロパティは、DtoSelectionItems コレクションを返します。

Count プロパティを使用してコレクション内のメンバー数を調べます。

Set first_setting = my_settings(1) 
 
type = first_setting.Type 
 
'選択タイプの設定の場合のみこれを呼び出す 
' 設定タイプ列挙を参照 
 
if (type = dtoSingleSel) OR (type = dtoMultiSel) 
Set all_the_selections = first_setting.AllPossibleSelections 

関連項目

DtoCategories コレクション

DtoSetting オブジェクト

メソッドの詳細

Add メソッド

DtoSelectionItems コレクションに項目を追加します。

構文

result = Collection.Add(Object) 

引数

Collection
オブジェクトを追加する DtoSelectionItems コレクション。
Object
追加する DtoSelectionItem オブジェクト。

戻り値

result
メソッド呼び出しの結果を示す DtoResult(Long 型の値)。DtoSession オブジェクトの Error プロパティを使って結果の説明を取得します。

備考

このメソッドには DtoSelectionItem タイプのパラメーターが必要です。このため、コレクションにオブジェクトを追加する前に、まずオブジェクトのインスタンスを作成してそのプロパティを設定する必要があります。

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 
 
'新しい値の割り当てを開始する 
'ItemID 1、2 および 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 メソッド

指定した ID で DtoSelectionItems コレクションから DtoSelectionItem オブジェクトを返します。

構文

my_selection_item = Collection.GetById(id) 

引数

Collection
DtoSelectionItems コレクション
id
コレクションから取得する項目の ID。特定の選択項目の ID は DtoSelectionItem オブジェクトの ItemId プロパティを使って取得することができます。

戻り値

my_selection_item

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 メソッド

DtoSelectionItems コレクションから項目を削除します。

構文

result = Collection.Remove(item) 

引数

Collection
DtoSelectionItems コレクション
item
コレクションから削除する項目の(1 から始まる)インデックスまたは選択項目の名前を含むバリアント。

戻り値

result
メソッド呼び出しの結果を示す DtoResult(Long 型の値)。DtoSession オブジェクトの Error プロパティを使って結果の説明を取得します。

備考

このメソッドには DtoSelectionItem タイプのパラメーターが必要です。

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 

DtoSetting オブジェクト

DtoSelectionItem オブジェクト