Back to Devexpress

BarManager.SaveToRegistry(String) Method

windowsforms-devexpress-dot-xtrabars-dot-barmanager-dot-savetoregistry-x28-system-dot-string-x29.md

latest3.1 KB
Original Source

BarManager.SaveToRegistry(String) Method

SECURITY-RELATED CONSIDERATIONS

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’s state to the system registry.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual bool SaveToRegistry(
    string path
)
vb
<EditorBrowsable(EditorBrowsableState.Never)>
Public Overridable Function SaveToRegistry(
    path As String
) As Boolean

Parameters

NameTypeDescription
pathString

Location of the BarManager data within the system registry.

|

Returns

TypeDescription
Boolean

true if the operation is successfully completed; otherwise, false.

|

Remarks

This method is obsolete. Use the BarManager.SaveLayoutToRegistry method instead.

Example

The following code demonstrates how to write and read a BarManager’s state to/from the system registry. The full path for the bars layout will be: HKEY_CURRENT_USER\DevExpress\XtraBars\States\MainState.

csharp
string regKey = "DevExpress\\XtraBars\\States\\MainState";
    barManager1.SaveLayoutToRegistry(regKey);

    //...

    barManager1.RestoreLayoutFromRegistry(regKey);
vb
Dim regKey As String = "DevExpress\XtraBars\States\MainState"
    BarManager1.SaveLayoutToRegistry(regKey)

    '...

    BarManager1.RestoreLayoutFromRegistry(regKey)

See Also

RestoreFromRegistry

Saving and Restoring a Bars Layout Manually

Saving and Restoring a Bars Layout Automatically

BarManager Class

BarManager Members

DevExpress.XtraBars Namespace