Version

LoadFromBinary(Stream) Method

Loads saved layout information from a stream containing the binary layout.
Syntax
'Declaration
 
Public Overloads Sub LoadFromBinary( _
   ByVal stream As Stream _
) 
public void LoadFromBinary( 
   Stream stream
)

Parameters

stream
Stream containing the serialized UltraTabbedMdiManager information
Remarks

The LoadFromBinary method is used in conjunction with the SaveAsBinary(Stream) method to persist the property settings and layout of the UltraTabbedMdiManager. All property settings (except the ImageList) are deserialized including the MdiTab objects and TabGroups. After the information has been deserialized, the RestoreTab event is invoked for each serialized MdiTab so that the appropriate Form may be associated with the tab. If the tab is not associated with a Form in this event, the tab will be discarded.

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