Attributes are declared as classes descending
from TCustomAttribute.
DemoAttribute =
class(TCustomAttribute)
private
FID : Integer;
public
constructor Create(ID : Integer);
property ID : Integer read FID write FID;
end;
Attributes can be applied to almost any type,
class, variable or method. The word attribute can be omitted from
the attribute name when applying them.
[Demo(1)]
TSomeClass = class
private
[Demo(2)]
FNamed : string;
public
[Demo(3)]
property Named : string read FName write FName;
[Demo(1)]
procedure DoStuff;
end;