Kiwi CatTools API: Devices class
The Devices class is used to enumerate CatTools Device objects and to enact changes to a Device, such as add, edit and delete.
Properties
Count |
Returns the number of devices in your database. |
Methods
AddNew |
Returns a Device. This Device can then have its settings modified before being saved to the database.
|
DeleteByDevice |
Deletes a device from the database.
|
DeleteByName | Deletes a device from the database using the devices name as an identifier. |
GetByName |
Returns a Device object.
|
Items |
The collection of Device objects. |
Refresh |
Resynchronize with the database. |
SaveDevice |
Saves a Device object to the database.
|
Example code: Device iterations
The following sample Visual Basic code showing you how to iterate devices using the CatTools API.
Dim DB As CatToolsAPI.Database Dim Devices As CatToolsAPI.Devices Dim Device As CatToolsAPI.Device Set DB = New CatToolsAPI.Database DB.OpenConnection If DB.Connected Then Set Devices = DB.Devices Debug.Print Devices.Count & " devices in the database" For Each Device In Devices If Device.Group = "Default" then Debug.Print Device.Name & " " & Device.HostAddress End If DoEvents Next Else Debug.Print "Connection failed: " & DB.ErrDescription End If DB.CloseConnection Set Device = Nothing Set Devices = Nothing Set DB = Nothing