page header

Attribute Definition Macro Definitions

The LLBLGen Pro designer allows you to specify attribute definitions for elements, which are used to produce .NET attribute definitions in the generated sourcecode. To add attribute definitions to an element, you either use the Project Settings Editor or edit the attributes on the code generation info tab of the element: (Entity, Typed List, Typed View or Value Type). To make the definition as generic as possible (so the attribute definition can be defined at the project level in the Project Properties Editor), macros can be used. The following macros are supported for attribute definitions.

The macros used in other areas like with additional interfaces, are supported as well. These have a slightly different syntax and are given below.

.NET Attribute definitions are defined using constants, it therefore might be necessary to specify a specific type for a constant. E.g. 10 is seen as an integer, but it might be necessary to define that as a byte or short/Int16. To do this, one should use the 5 specific cast keywords if the value specified is ambiguistic and by default is seen as a value of a different type: numbers without fraction are by default seen as integers by compilers and numbers with fraction are by default seen as doubles. To specify a cast, use the syntax: $typename(value). For example: $byte(10). This will resolve to either (byte)(10) for C#, or to CByte(10) for VB.NET. Not specifying the value in parenthesis could cause problems for vb.net and there's no checking done on this.

It's not necessary to wrap the attribute in [] characters for C# or <> characters for VB.NET nor is it necessary to append a '_' for VB.NET, this is done by the code generator automatically.


LLBLGen Pro Designer v3.5 documentation. ©2002-2012 Solutions Design