Refresh Method

Summary
Rebuilds the device collection.
Syntax
C#
C++/CLI
public void Refresh() 
public: 
void Refresh();  
Remarks

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.

Example
C#
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 control 
   ConvertCtrl convertctrl = _form.ConvertCtrl; 
 
   try 
   { 
      // get the target devices object 
      TargetDevices devices = convertctrl.TargetDevices; 
 
      // select an input by name if possible 
      if (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 device  
      string 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 it 
      foreach (TargetDevice td in devices) 
      { 
         // get the inputs properties 
         inputName = td.Name; 
         inputFriendlyName = td.FriendlyName; 
 
         // if we found a target audio device 
         if (inputFriendlyName.Contains("Audio")) 
         { 
            // select it and break 
            td.Selected = true; 
            break; 
         } 
      } 
 
      // set the result to what we expect 
      _result = (selectedCamera != devices.Selection); 
 
   } 
   catch (Exception) 
   { 
      _result = false; 
   } 
} 
Requirements

Target Platforms

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Multimedia Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.