Delphi .NET (2) Database (71) Delphi IDE (90) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280)
Exchange Links About this site Links to us 
|
RTTI - determining property information
This article has not been rated yet. After reading, feel free to leave comments and rate it.
Question:
A RTTI question - it is possible to determine if a certain property is Read-Only, Write-Only or stored?
Answer:
The following code checks whether a property can be written to, read or whether it is stored.
 | |  | | function IsWriteProp(Info: PPropInfo) : Boolean;
begin
Result := Assigned(Info) and (Info^.SetProc<>nil)
end;
function IsReadProp : Boolean;
begin
Result := Assigned(Info) and (Info^.GetProc<>nil)
end;
function IsStoredProp : Boolean;
begin
Result := Assigned(Info) and TYPINFO.IsStoredProp(FObj, Info)
end; | |  | |  | You don't like the formatting? Check out SourceCoder then!
Comments:
|