Delphi 中的 Producer 和 ProducerContent 有什么区别?

What is the difference between Producer and ProducerContent in Delphi?

在 Delphi 中,TWebActionItem.Producer 和 TWebActionItem.ProducerContent 属性在 Web Brokers 中用于在操作时生成响应消息的内容项目执行。

TWebActionItem.Producer 和 TWebActionItem.Producer 内容有什么区别? 我们应该使用哪一个?

来自 TWebActionItem.ProducerContent 文档:

This property is identical to Producer except for the type of content producer. ProducerContent is used when the producer is of type IProduceContent instead of TCustomContentProducer. In the latter case, the property Producer is set instead. Note that Producer and ProducerContent are mutually exclusive; if one is set, the other must not be.

所以你应该使用适合响应内容制作者类型的那个。如果那个生产者的类型是IProduceContent,你使用ProducerContent;如果生产者是 ICustomerContentProducer 类型,您将使用 Producer 代替。