Back to Devexpress

BaseAppearanceCollection.SaveLayoutToRegistry(String) Method

windowsforms-devexpress-dot-utils-dot-baseappearancecollection-dot-savelayouttoregistry-x28-system-dot-string-x29.md

latest3.6 KB
Original Source

BaseAppearanceCollection.SaveLayoutToRegistry(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 appearance settings to a system registry path.

Namespace : DevExpress.Utils

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public virtual void SaveLayoutToRegistry(
    string path
)
vb
Public Overridable Sub SaveLayoutToRegistry(
    path As String
)

Parameters

NameTypeDescription
pathString

A string value specifying the system registry path to which the appearance settings are saved.

|

Remarks

Use the SaveLayoutToRegistry method to save the activated appearance settings to the system registry. The appearance settings are activated if their corresponding options are enabled. You can then restore these settings using the BaseAppearanceCollection.RestoreLayoutFromRegistry method.

You can define whole and partial registry keys as the parameter. For instance, specifying “Software\MyCompany\MyProject" as a partial key will result in saving settings to the “HKEY_CURRENT_USER\Software\MyCompany\MyProject" path. You can also specify the entire path if you need to store the appearance settings to another root key, for instance “HKEY_LOCAL_MACHINE\Software\MyCompany\MyProject".

Example

The following code can be used to write and read the appearance settings applied to the XtraGrid’s elements to/from the system registry. The full path used is: HKEY_CURRENT_USER\DevExpress\Utils\Layouts\Appearance.

csharp
string regKey = "DevExpress\\Utils\\Layouts\\Appearance";
gridControl1.MainView.Appearance.SaveLayoutToRegistry(regKey);

//...

gridControl1.MainView.Appearance.RestoreLayoutFromRegistry(regKey);
vb
Dim regKey As String = "DevExpress\Utils\Layouts\Appearance"
gridControl1.MainView.Appearance.SaveLayoutToRegistry(regKey)

'...

gridControl1.MainView.Appearance.RestoreLayoutFromRegistry(regKey)

See Also

RestoreLayoutFromRegistry(String)

SaveLayoutToStream(Stream)

SaveLayoutToXml(String)

Save and Restore Layouts of DevExpress controls

BaseAppearanceCollection Class

BaseAppearanceCollection Members

DevExpress.Utils Namespace