Version

SaveAsXml(Stream) Method

Saves layout information to an xml/soap stream.
Syntax
'Declaration
 
Public Overloads Sub SaveAsXml( _
   ByVal stream As Stream _
) 
public void SaveAsXml( 
   Stream stream
)

Parameters

stream
Stream to receive the serialized UltraTabbedMdiManager information
Remarks

The SaveAsXml method is used in conjunction with the LoadFromXml(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 an xml/soap UltraTabbedMdiManager layout to/from a file stream.

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

Private Sub SaveXmlLayout()
    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.SaveAsXml(fs)
    Finally
        fs.Close()
    End Try
End Sub

Private Sub LoadXmlLayout()
    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.LoadFromXml(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 SaveXmlLayout()
{
	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.SaveAsXml(fs);
	}
	finally
	{
		fs.Close();
	}
}

private void LoadXmlLayout()
{
	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.LoadFromXml(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