Version

SaveAsXml(Stream,Boolean) Method

Saves toolbar data to the specified stream in XML (Soap) format.
Syntax
'Declaration
 
Public Overloads Sub SaveAsXml( _
   ByVal stream As Stream, _
   ByVal saveCustomizations As Boolean _
) 
public void SaveAsXml( 
   Stream stream,
   bool saveCustomizations
)

Parameters

stream
The stream to write to.
saveCustomizations
If true will save user customizations.
Example
The following code shows how to save a toolbar layout to an XML stream.

Imports System.Diagnostics
Imports System.IO
Imports System.Runtime.Serialization
Imports System.Runtime.Serialization.Formatters.Binary
Imports System.Runtime.Serialization.Formatters.Soap
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinToolbars

	Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click

		Try
			Dim Stream As New FileStream("C:\\Layout.xml", FileMode.OpenOrCreate)
			Stream.Seek(0, SeekOrigin.Begin)

			Try
				Me.UltraToolbarsManager1.SaveAsXml(Stream, True)
			Catch
				MessageBox.Show(Me, "Error encountered while saving to stream!", "Save Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
			End Try

			Stream.Close()
		Catch
			Debug.WriteLine("Error encountered while saving stream!")
		End Try

	End Sub
using System.Diagnostics;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization.Formatters.Soap;
using Infragistics.Win;
using Infragistics.Win.UltraWinToolbars;

		private void button10_Click(object sender, System.EventArgs e)
		{

			try
			{
				FileStream stream = new FileStream("C:\\Layout.xml", FileMode.OpenOrCreate);
				stream.Seek(0, SeekOrigin.Begin);

				try
				{
					this.ultraToolbarsManager1.SaveAsXml(stream, true);
				}
				catch
				{
					MessageBox.Show(this, "Error encountered while saving to stream!", "Save Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				}

				stream.Close();
			}
			catch
			{
				Debug.WriteLine("Error encountered while saving stream!");
			}

		}
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