C#
VB
C++
Rebuilds the device collection.
public void Refresh() Public Sub Refresh() public:void Refresh();
Rebuilds the device collection. This method will rebuild the collection of system-registered devices. It is usually called from applications that respond to system device change notifications. If the method fails, an error is raised. For more information, refer to the Error Codes.
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public bool _result = false;public ConvertCtrlForm _form = new ConvertCtrlForm();public void TargetDevicesExample(){string inputName, inputFriendlyName;int selectedCamera;// reference the convert controlConvertCtrl convertctrl = _form.ConvertCtrl;try{// get the target devices objectTargetDevices devices = convertctrl.TargetDevices;// select an input by name if possibleif (devices["Microsoft DV Camera"] == null)throw new Exception("No MS DV Camera device available!");devices["Microsoft DV Camera"].Selected = true;// get the full friendly name of the devicestring friendlyName = devices["Microsoft DV Camera"].FriendlyName;// get the selected index of the currently selected target device// (the MS DV camera above)selectedCamera = devices.Selection;// now enumerate all the target devices,// looking for an audio device and select itforeach (TargetDevice td in devices){// get the inputs propertiesinputName = td.Name;inputFriendlyName = td.FriendlyName;// if we found a target audio deviceif (inputFriendlyName.Contains("Audio")){// select it and breaktd.Selected = true;break;}}// set the result to what we expect_result = (selectedCamera != devices.Selection);}catch (Exception){_result = false;}}
Imports LeadtoolsImports Leadtools.MultimediaImports LeadtoolsMultimediaExamples.FixturesPublic _result As Boolean = FalsePublic _form As ConvertCtrlForm = New ConvertCtrlForm()Public Sub TargetDevicesExample()Dim inputName, inputFriendlyName As StringDim selectedCamera As Integer' reference the convert controlDim convertctrl As ConvertCtrl = _form.ConvertCtrlTry' get the target devices objectDim devices As TargetDevices = convertctrl.TargetDevices' select an input by name if possibleIf devices("Microsoft DV Camera") Is Nothing ThenThrow New Exception("No MS DV Camera device available!")End Ifdevices("Microsoft DV Camera").Selected = True' get the full friendly name of the deviceDim friendlyName As String = devices("Microsoft DV Camera").FriendlyName' get the selected index of the currently selected target device' (the MS DV camera above)selectedCamera = devices.Selection' now enumerate all the target devices,' looking for an audio device and select itFor Each td As TargetDevice In devices' get the inputs propertiesinputName = td.NameinputFriendlyName = td.FriendlyName' if we found a target audio deviceIf inputFriendlyName.Contains("Audio") Then' select it and breaktd.Selected = TrueExit ForEnd IfNext td' set the result to what we expect_result = (selectedCamera <> devices.Selection)Catch e1 As Exception_result = FalseEnd TryEnd Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
