VintaSoft Twain .NET SDK v10.2
Vintasoft.Twain Namespace / DeviceCapabilityCollection Class / Load Method
Stream with current values of capabilites.
Example




In This Topic
    Load Method (DeviceCapabilityCollection)
    In This Topic
    Loads current values of capabilities from the stream.
    Syntax
    'Declaration
     
    Public Sub Load( _
       ByVal stream As Stream _
    ) 
    'Usage
     
    Dim instance As DeviceCapabilityCollection
    Dim stream As Stream
     
    instance.Load(stream)
    public void Load( 
       Stream stream
    )
    public: void Load( 
       Stream* stream
    ) 
    public:
    void Load( 
       Stream^ stream
    ) 

    Parameters

    stream
    Stream with current values of capabilites.
    Exceptions
    ExceptionDescription
    Thrown if stream is null (Nothing in VB).
    Thrown if stream does not support reading.
    Thrown if device is in wrong state.
    Thrown if device does not support capability.
    Thrown if the .NET debugger is used and the function evaluation requires all threads to run.
    Example
    This example shows how to load previously saved values of device capabilities.
    ''' <summary>
    ''' Loads the device capability collection from file.
    ''' </summary>
    Private Sub LoadDeviceCapabilitCollection(ByVal device As Device)
        ' open the device
        device.Open()
        ' open file
        Using fs As New FileStream("scanner-capabilities.xml", FileMode.Open, FileAccess.Read)
            ' load the device capability collection from file
            device.Capabilities.Load(fs)
        End Using
    End Sub
    /// <summary>
    /// Loads the device capability collection from file.
    /// </summary>
    /// <param name="device"></param>
    public static void LoadDeviceCapabilityCollection(Device device)
    {
        // open the device
        device.Open();
        // open file
        using (FileStream fs = new FileStream("scanner-capabilities.xml", FileMode.Open, FileAccess.Read))
        {
            // load the device capability collection from file
            device.Capabilities.Load(fs);
        }
    }
    Requirements

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

    See Also