Version

SaveAsBinary(Stream) Method

Saves layout information to a binary stream.
Syntax
'Declaration
 
Public Overloads Sub SaveAsBinary( _
   ByVal stream As Stream _
) 
public void SaveAsBinary( 
   Stream stream
)

Parameters

stream
Stream containing the serialized UltraTabbedMdiManager information
Remarks

The SaveAsBinary method is used in conjunction with the LoadFromBinary(Stream) method to persist the property settings and layout of the UltraTabbedMdiManager. All property settings (except the ImageList) are serialized including the MdiTab objects and TabGroups. When the method is invoked, the StoreTab event is invoked for each MdiTab so that the PersistedInfo may be updated. This property will be available upon deserialization and should be set to a value that can be used to create the appropriate form in the RestoreTab event.

Example
The following example demonstrates how to load and save a binary UltraTabbedMdiManager layout to/from a file stream.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs
Imports Infragistics.Win.UltraWinTabbedMdi

Private Sub SaveBinaryLayout()

    Dim path As String = System.IO.Path.GetDirectoryName(Application.ExecutablePath)
    Dim fileName As String = path + "\\TabbedMdiLayout.dat"

    Dim fs As System.IO.FileStream = New System.IO.FileStream(fileName, System.IO.FileMode.OpenOrCreate)

    Try
        fs.Seek(0, System.IO.SeekOrigin.Begin)
        Me.ultraTabbedMdiManager1.SaveAsBinary(fs)
    Finally
        fs.Close()
    End Try
End Sub

Private Sub LoadBinaryLayout()
    Dim path As String = System.IO.Path.GetDirectoryName(Application.ExecutablePath)
    Dim fileName As String = path + "\\TabbedMdiLayout.dat"

    Dim fs As System.IO.FileStream = Nothing

    If Not System.IO.File.Exists(fileName) Then
        Return
    End If

    Try
        fs = New System.IO.FileStream(fileName, System.IO.FileMode.Open)
        fs.Seek(0, System.IO.SeekOrigin.Begin)

        Me.ultraTabbedMdiManager1.LoadFromBinary(fs)
    Finally
        If Not fs Is Nothing Then
            fs.Close()
        End If
    End Try
End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabbedMdi;

private void SaveBinaryLayout()
{
	string path = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
	string fileName = path + "\\TabbedMdiLayout.dat";

	System.IO.FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode.OpenOrCreate);

	try
	{
		fs.Seek(0, System.IO.SeekOrigin.Begin);
		this.ultraTabbedMdiManager1.SaveAsBinary(fs);
	}
	finally
	{
		fs.Close();
	}
}

private void LoadBinaryLayout()
{
	string path = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
	string fileName = path + "\\TabbedMdiLayout.dat";

	System.IO.FileStream fs = null;

	if (!System.IO.File.Exists(fileName))
		return;

	try
	{
		fs = new System.IO.FileStream(fileName, System.IO.FileMode.Open);
		fs.Seek(0, System.IO.SeekOrigin.Begin);

		this.ultraTabbedMdiManager1.LoadFromBinary(fs);
	}
	finally
	{
		if (fs != null)
			fs.Close();
	}
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also