使用 _ 事件符号调用 Acumatica 事件的委托
Calling delegate for Acumatica Event with the _ event notation
以前,为了在事件处理程序中间注入代码,您可以使用代码:
protected virtual void Customer_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
{
// run before the base event
del?.Invoke(cache, e);
// run after the base event
}
采用新的活动风格:
protected virtual void _(Events.RowSelected<Customer> e)
调用委托的正确方法是什么?
我在 APInvoiceEntryExt.cs 的扩展库中提供的代码中找到了一个示例。以下代码是您完成此操作的方法:
protected virtual void _(Events.RowSelected<Customer> e, PXRowSelected del)
{
// run before the base event
del?.Invoke(e.Cache, e.Args);
// run after the base event
}
以前,为了在事件处理程序中间注入代码,您可以使用代码:
protected virtual void Customer_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
{
// run before the base event
del?.Invoke(cache, e);
// run after the base event
}
采用新的活动风格:
protected virtual void _(Events.RowSelected<Customer> e)
调用委托的正确方法是什么?
我在 APInvoiceEntryExt.cs 的扩展库中提供的代码中找到了一个示例。以下代码是您完成此操作的方法:
protected virtual void _(Events.RowSelected<Customer> e, PXRowSelected del)
{
// run before the base event
del?.Invoke(e.Cache, e.Args);
// run after the base event
}