DeserializationSettings.InvokeTrusted(Action) Method
Turns off safe deserialization for a certain section of code.
Namespace: DevExpress.Utils
Assembly: DevExpress.Data.v24.2.dll
Declaration
Parameters
Name | Type |
---|---|
trustedAction | Action |
Remarks
DevExpress UI controls automatically detect potentially dangerous data types, block their deserialization, and throw a security-related exception.
If you trust a data source, call the InvokeTrusted
method to turn off safe deserialization for certain sections of code:
DevExpress.Utils.DeserializationSettings.InvokeTrusted(()=>{
using(var ms = new MemoryStream()){
gridView1.SaveLayoutToStream(ms);
// Trusted source
ms.Position = 0;
gridView2.RestoreLayoutFromStream(ms);
}
});
Read the following topic for more information: Safe Deserialization.
See Also