Back to Devexpress

PropertyAllowEventArgs.Allow Property

corelibraries-devexpress-dot-utils-dot-propertyalloweventargs.md

latest2.1 KB
Original Source

PropertyAllowEventArgs.Allow Property

Gets or sets whether to allow property serialization or deserialization.

Namespace : DevExpress.Utils

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public DefaultBoolean Allow { get; set; }
vb
Public Property Allow As DefaultBoolean

Property Value

TypeDescription
DefaultBoolean

True, Default to allow property serialization or deserialization; otherwise, False.

|

Available values:

NameDescriptionReturn Value
True

The value is true.

|

0

| | False |

The value is false.

|

1

| | Default |

The value is specified by a global option or a higher-level object.

|

2

|

Remarks

Use the Allow option to allow or disallow property serialization or deserialization. The PropertyName property identify which property/setting is currently being processed.

Example

The following example demonstrates how to avoid serializing certain settings:

csharp
treeList.PropertySerializing += (s, e) => {
    if(e.Owner is TreeListColumn && e.PropertyName == "Caption")
        e.Allow = DefaultBoolean.False;
};
vb
AddHandler treeList.PropertySerializing, Sub(s, e)
    If TypeOf e.Owner Is TreeListColumn AndAlso e.PropertyName = "Caption" Then
        e.Allow = DefaultBoolean.False
    End If
End Sub

See Also

PropertyAllowEventArgs Class

PropertyAllowEventArgs Members

DevExpress.Utils Namespace