TJvAppXMLFileStorage OnGetFileName 事件从未执行

TJvAppXMLFileStorage OnGetFileName event never executed

在 Delphi 10 Seattle 中,使用 JVCL 3.48,在实现 TJvAppXMLFileStorage OnGetFileName 事件处理程序后,它永远不会执行:

procedure TForm1.JvAppXMLFileStorage1GetFileName(Sender:
    TJvCustomAppStorage; var FileName: TFileName);
begin
  // never gets executed!
  CodeSite.Send('JvAppXMLFileStorage1GetFileName', FileName.ToString);
end;

我需要此事件根据其他设置使用 var FileName 参数设置 JvAppXMLFileStorage1.Location 属性。

那么我怎样才能执行这个事件呢?

快速浏览一下 JvAppStorage.pas 似乎表明唯一调用 DoGetFileName 的地方(这是触发 OnGetFileName 的地方,如果有一个分配)在 TJvCustomAppMemoryFileStorage.RecalculateFullFileName 中。查看该方法,DoGetFileName 仅从 flCustomcase Location of 分支调用。

这似乎表明事件只有在分配 时才会触发,LocationflCustom