VintaSoft Twain .NET SDK v10.2
DeviceManager Class
Members  Example 




Vintasoft.Twain Namespace : DeviceManager Class
Class that allows to manipulate TWAIN device manager.
Object Model
DeviceManager ClassDevice ClassDeviceCollection ClassDevice ClassDevice Class
Syntax
'Declaration
 
<ToolboxBitmapAttribute()>
<LicenseProviderAttribute(Vintasoft.Twain.VintasoftLicenseProvider)>
<ComVisibleAttribute(True)>
Public NotInheritable Class DeviceManager 
   Inherits System.ComponentModel.Component
'Usage
 
Dim instance As DeviceManager
[ToolboxBitmap()]
[LicenseProvider(Vintasoft.Twain.VintasoftLicenseProvider)]
[ComVisible(true)]
public sealed class DeviceManager : System.ComponentModel.Component 
[ToolboxBitmap()]
[LicenseProvider(Vintasoft.Twain.VintasoftLicenseProvider)]
[ComVisible(true)]
public __gc __sealed class DeviceManager : public System.ComponentModel.Component 
[ToolboxBitmap()]
[LicenseProvider(Vintasoft.Twain.VintasoftLicenseProvider)]
[ComVisible(true)]
public ref class DeviceManager sealed : public System.ComponentModel.Component 
Remarks
Class allows to:
Example
This example shows how to select the device and acquire images from the device.
' Starts the asynchronous image acquisition from scanner.
Private Sub StartScan(ByVal deviceManager As DeviceManager)
    ' specify TWAIN name of this application
    deviceManager.ApplicationProductName = "MyTwainApplication"
    Try
        ' open the device manager
        deviceManager.Open()
            
        ' show the default device selection dialog
        If Not deviceManager.ShowDefaultDeviceSelectionDialog() Then
            ' exit if default device is not selected
            Return
        End If
            
        ' get reference to the default device
        Dim device As Device = deviceManager.DefaultDevice
        ' acquire image(s) from the device
        device.Acquire()
    Catch ex As TwainException
        Console.WriteLine(ex.Message)
    End Try
End Sub
// Starts the asynchronous image acquisition from scanner.
void StartScan(DeviceManager deviceManager)
{
    // specify TWAIN name of this application
    deviceManager.ApplicationProductName = "MyTwainApplication";
    try
    {
        // open the device manager
        deviceManager.Open();
            
        // show the default device selection dialog
        if (!deviceManager.ShowDefaultDeviceSelectionDialog())
            // exit if default device is not selected
            return;
            
        // get reference to the default device
        Device device = deviceManager.DefaultDevice;
        // acquire image(s) from the device
        device.Acquire();
    }
    catch (TwainException ex)
    {
        Console.WriteLine(ex.Message);
    }
}
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         Vintasoft.Twain.DeviceManager

Requirements

Target Platforms: Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

See Also

Reference

DeviceManager Members
Vintasoft.Twain Namespace