VintaSoft Twain .NET SDK v10.2
Save Method (DeviceCapabilityCollection)
Example 




Vintasoft.Twain Namespace > DeviceCapabilityCollection Class : Save Method
Stream to save the current values of capabilities.
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.
Example
This example shows how to save values of current device capabilities to a file.
Private Sub SaveDeviceCapabilitCollection(ByVal device As Device)
    device.Open()
    Dim fs As New FileStream("scanner-capabilities.xml", FileMode.Append, FileAccess.Write)
    device.Capabilities.Save(fs)
    fs.Close()
End Sub
private void SaveDeviceCapabilitCollection(Device device)
{
    device.Open();
    FileStream fs = new FileStream("scanner-capabilities.xml", FileMode.Append, FileAccess.Write);
    device.Capabilities.Save(fs);
    fs.Close();
}
Requirements

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

See Also

Reference

DeviceCapabilityCollection Class
DeviceCapabilityCollection Members
Load Method