windowsforms-devexpress-dot-xtrabars-dot-barmanager-dot-savetoxml-x28-system-dot-string-x29.md
Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.
Saves the BarManager component state to an xml file.
Namespace : DevExpress.XtraBars
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual void SaveToXml(
string xmlFile
)
<EditorBrowsable(EditorBrowsableState.Never)>
Public Overridable Sub SaveToXml(
xmlFile As String
)
| Name | Type | Description |
|---|---|---|
| xmlFile | String |
An xml file to which the BarManager component’s state is saved.
|
This method is obsolete. Use the BarManager.SaveLayoutToXml method instead.
The following code can be used to read and write a BarManager’s state from/to an XML file.
string xmlFile = "c:\\XtraBars\\States\\MainState.xml";
barManager1.SaveLayoutToXml(xmlFile);
//...
barManager1.RestoreLayoutFromXml(xmlFile);
Dim xmlFile As String = "c:\XtraBars\States\MainState.xml"
BarManager1.SaveLayoutLayoutToXml(xmlFile)
'...
BarManager1.RestoreLayoutLayoutFromXml(xmlFile)
See Also
Saving and Restoring a Bars Layout Manually