Connectivity Software User's Guide and Reference
SaveToFile Method



OpcLabs.BaseLibPrimitives Assembly > OpcLabs.BaseLib.Persistence.Extensions Namespace > IStreamPersistableExtension Class : SaveToFile Method
The stream persistable object.

The value of this parameter cannot be null (Nothing in Visual Basic).

The name of the file to save to.

The value of this parameter cannot be null (Nothing in Visual Basic).

Saves the state of the OpcLabs.BaseLib.Persistence.IStreamPersistable object to a file.
Syntax
'Declaration
 
<ExtensionAttribute()>
<JetBrains.Annotations.CanBeNullAttribute()>
Public Shared Function SaveToFile( _
   ByVal streamPersistable As IStreamPersistable, _
   ByVal fileName As String _
) As Exception
'Usage
 
Dim streamPersistable As IStreamPersistable
Dim fileName As String
Dim value As Exception
 
value = IStreamPersistableExtension.SaveToFile(streamPersistable, fileName)
[Extension()]
[JetBrains.Annotations.CanBeNull()]
public static Exception SaveToFile( 
   IStreamPersistable streamPersistable,
   string fileName
)
[Extension()]
[JetBrains.Annotations.CanBeNull()]
public:
static Exception^ SaveToFile( 
   IStreamPersistable^ streamPersistable,
   String^ fileName
) 

Parameters

streamPersistable
The stream persistable object.

The value of this parameter cannot be null (Nothing in Visual Basic).

fileName
The name of the file to save to.

The value of this parameter cannot be null (Nothing in Visual Basic).

Return Value

An exception object if an error occurred; otherwise, null.

This method can return null (Nothing in Visual Basic).

Remarks

This is an extension method (info: C#, VB.NET). In languages that have support for extensions methods (such as C# and VB.NET), you can use the extension method as if it were a regular method on the object that is its first parameter. In other languages (such as with Python.NET), you will call the extension as a static method, and pass it the object on which it acts as its first parameter.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also