This example creates a private string field FAdditional and public property Additional (which getter and setter refers to private field) to the class TEmployees:
procedure OnClassGenerated(Args: TClassGeneratedArgs);
begin
case Args.CodeType.Name of
'TEmployees':
begin
Args.CodeType.AddField('FAdditional', 'string', mvPrivate);
Args.CodeType.AddProperty('Additional', 'string',
'FAdditional', 'FAdditional', mvPublic);
end;
end;
end;
This will create the following private field and public property:
private
FAdditional: string;
public
property Additional: string read FAdditional write FAdditional;