VintaSoft Twain .NET SDK 14.1: Documentation for .NET developer
Vintasoft.Twain Namespace / DeviceCapabilityCollection Class / Load(Stream) Method
Syntax Exceptions Example Requirements SeeAlso
In This Topic
    Load(Stream) Method (DeviceCapabilityCollection)
    In This Topic
    Loads current values of capabilities from the stream.
    Syntax
    'Declaration
    
    Public Sub Load( _
    ByVal stream
    Stream with current values of capabilites.
    As System.IO.Stream _
    )
    public void Load(
    System.IO.Stream stream
    )
    public: void Load(
    System.IO.Stream* stream
    )
    public:
    void Load(
    System.IO.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 C#/VB.NET code 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 Vintasoft.Twain.Device)
        ' open the device
        device.Open()
        ' open file
        Using fs As New IO.FileStream("scanner-capabilities.xml", IO.FileMode.Open, IO.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(Vintasoft.Twain.Device device)
    {
        // open the device
        device.Open();
        // open file
        using (System.IO.FileStream fs = new System.IO.FileStream("scanner-capabilities.xml", System.IO.FileMode.Open, System.IO.FileAccess.Read))
        {
            // load the device capability collection from file
            device.Capabilities.Load(fs);
        }
    }
    
    

    Requirements

    Target Platforms: .NET 8, .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also