In a code such as this, that returns a List(Of IdName):
Dim login As Common.ILogin = Editorial.EditorialLogin.GetLogin()
Dim sc As SearchConditions = New SearchConditions(Schema.Class.copyrightObj.ObjectTypeName)
Dim list As List(Of IdName) = login.ListObjs(sc, False)
you can do following things:
•Exit if list is empty:
If list.Count = 0 Then Exit Sub
•Iterate entire list (reading only id and name):
For Each item As IdName In list
Dim objid = item.Id
Dim objName = item.Name
Next
•Return true if the item is found by name:
' returns true if a format with name strFormatName exists for the element type strTypeName
Dim catList = New List(Of Integer)
Dim aFormats As List(Of IdName) = Ted.TxtFormatList(0, typographyId, Fred.GetTypeIdFromName(strTypeName), catList, 0)
If Not aFormats Is Nothing Then
For Each item As IdName In aFormats
If LCase(item.Name) = LCase(strFormatName) Then Return True
Next
End If