|
Method properties (events)
TProperty class allows to get all information about event using the MethodKind, ParamCount, ParamFlags, ParamNames, ParamTypes and ResultType properties. Two special properties: Parameters and MethodDeclaration returns processed information about each paremeter and about the procedural type declaration. The following code shows the information about OnClose event.
procedure TForm1.FormClick(Sender: TObject);
var
P: TProperty;
S: string;
begin
with TPropertyList.Create(nil) do
try
Instance:=Self;
Root:=Self;
P:=FindProperty('OnClose');
if Assigned(P) then
ShowMessage(P.Name+' event is '+P.TypeName+' and declared as'#13+
P.MethodDeclaration)
finally
Free;
end;
end;
|