IMemberInfo.AddAttribute(Attribute, Boolean) Method
Dynamically associates the specified attribute with the current member.
Namespace: DevExpress.ExpressApp.DC
Assembly: DevExpress.ExpressApp.v25.2.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Parameters
| Name | Type | Description |
|---|---|---|
| attribute | Attribute | An attribute to be associated with the current member. |
| skipRefresh | Boolean |
|
Returns
| Type | Description |
|---|---|
| IMemberInfo | An object that allows you to further interact with member metadata information. |
Remarks
public override void CustomizeTypesInfo(DevExpress.ExpressApp.DC.ITypesInfo typesInfo) {
base.CustomizeTypesInfo(typesInfo);
CalculatedPersistentAliasHelper.CustomizeTypesInfo(typesInfo);
ITypeInfo pType = typesInfo.FindTypeInfo(typeof(PersistentObject1));
pType.CreateMember("CustomDecimalField", typeof(decimal))
.AddAttribute(new ModelDefaultAttribute("DisplayFormat", "n2"))
.AddAttribute(new ModelDefaultAttribute("EditMask", "n2"));
// ...
typesInfo.RefreshInfo(typeof(PersistentObject1));
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AddAttribute(Attribute, Boolean) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.