Registriert seit: 10. Jul 2008
166 Beiträge
Delphi XE Professional
|
AW: RTTI - Property - SetValue
27. Dez 2010, 23:49
So gehts:
Delphi-Quellcode:
// Testklasse
TTest = class
private
FStr: string;
public/published
property Str: string read FStr write FStr;
end;
// Wert schreiben
if Assigned(PropInfo) then
begin
PropValue := TValue.From(Value);
PropInfo.SetValue(T, PropValue);
end;
Geändert von Björn Ole (27. Dez 2010 um 23:57 Uhr)
|