VintaSoft Twain .NET SDK v10.2
Vintasoft.WpfTwain Namespace / DeviceCapabilityCollection Class / Save Method
Stream to save the current values of capabilities.
Example




In This Topic
    Save Method (DeviceCapabilityCollection)
    In This Topic
    Saves information about current values of capabilites to the stream.
    Syntax
    'Declaration
     
    Public Sub Save( _
       ByVal stream As Stream _
    ) 
    'Usage
     
    Dim instance As DeviceCapabilityCollection
    Dim stream As Stream
     
    instance.Save(stream)
    public void Save( 
       Stream stream
    )
    public: void Save( 
       Stream* stream
    ) 
    public:
    void Save( 
       Stream^ stream
    ) 

    Parameters

    stream
    Stream to save the current values of capabilities.
    Exceptions
    ExceptionDescription
    Thrown if stream is null (Nothing in VB).
    Thrown if the stream does not support writing.
    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.
    Remarks
    The method ignores the "custom" capabilities, i.e. capabilities, which are added using the Add method.
    Example
    This example shows how to save values of current device capabilities to a file.
    ''' <summary>
    ''' Saves the device capability collection to a file.
    ''' </summary>
    Private Sub SaveDeviceCapabilitCollection(ByVal device As Device)
        ' open the device
        device.Open()
        ' open file
        Using fs As New FileStream("scanner-capabilities.xml", FileMode.Append, FileAccess.Write)
            ' save the device capability collection to a file
            device.Capabilities.Save(fs)
        End Using
    End Sub
    /// <summary>
    /// Saves the device capability collection to a file.
    /// </summary>
    public static void SaveDeviceCapabilityCollection(Device device)
    {
        // open the device
        device.Open();
        // open file
        using (FileStream fs = new FileStream("scanner-capabilities.xml", FileMode.Append, FileAccess.Write))
        {
            // save the device capability collection to a file
            device.Capabilities.Save(fs);
        }
    }
    Requirements

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

    See Also