Back to Devexpress

BaseAppearanceCollection.RestoreLayoutFromRegistry(String) Method

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

latest3.5 KB
Original Source

BaseAppearanceCollection.RestoreLayoutFromRegistry(String) Method

SECURITY-RELATED CONSIDERATIONS

Deserializing layout settings from untrusted resources may create security issues. Review the following help topic for additional information: Safe Deserialization.

Restores the appearance settings stored at the specified system registry path.

Namespace : DevExpress.Utils

Assembly : DevExpress.Utils.v25.2.dll

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

Declaration

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

Parameters

NameTypeDescription
pathString

A string value specifying the system registry path. If the specified path doesn’t exist, calling this method has no effect.

|

Remarks

Use the `RestoreLayoutFromRegistry`` method to restore appearance settings written to the system registry by the BaseAppearanceCollection.SaveLayoutToRegistry method.

Whole and partial registry keys can be used for this method’s parameter. For example, if “Software\Company" is passed as the parameter the full path will be: “HKEY_CURRENT_USER\Software\Company". If you wish to store the settings in another root key, you should define the entire path for example “HKEY_LOCAL_MACHINE\Software\Company".

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

SaveLayoutToRegistry(String)

RestoreLayoutFromStream(Stream)

RestoreLayoutFromXml(String)

Save and Restore Layouts of DevExpress controls

BaseAppearanceCollection Class

BaseAppearanceCollection Members

DevExpress.Utils Namespace