IBaseInfo.AddAttribute(Attribute) Method
Dynamically associates the specified attribute with the current type or member.
Namespace: DevExpress.ExpressApp.DC
Assembly: DevExpress.ExpressApp.v26.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Parameters
| Name | Type | Description |
|---|---|---|
| attribute | Attribute | An attribute to be associated with the current type or member. |
Returns
| Type | Description |
|---|---|
| IBaseInfo | An object that allows you to further interact with type/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));
}
See Also