リストしたいいくつかの公開されたプロパティを持つクラスがあります。プロパティは、DevExpress スタイルからの TcxCustomStyle タイプです。次のコードを使用して名前を memdata テーブルに追加し、関連する TcxCustomStyle をすべて削除すると問題なく動作します。
問題は、TcxCustomStyle 型のプロパティの値を取得する方法です。
ほとんどの場合、それは私の側の単純なエラーですが、何が原因かわかりません。
procedure TfrmMain.ListProperties;
var
ctx: TRttiContext;
rType: TRttiType;
rProp: TRttiProperty;
i: integer;
Value: TcxCustomStyle;
begin
i := 1;
memProperties.DisableControls;
try
memProperties.Close;
memProperties.Open;
rType := ctx.GetType(Settings.Styling.ClassType);
for rProp in rType.GetProperties do
begin
Value := TcxCustomStyle(rProp.GetValue(Self).AsObject);
memProperties.AppendRecord([i, rProp.Name, Value.Name]);
Inc(i);
end;
finally
ctx.Free;
memProperties.EnableControls;
end;
end;