gpt4 book ai didi

caliburn.micro - EventAggregator.PublishOnUIThread(aMessage) 是否与 EventAggregator.Publish(aMessage,Execute.OnUIThread) 相同?

转载 作者:行者123 更新时间:2023-12-04 06:53:01 24 4
gpt4 key购买 nike

Micro 2.x 用户,

我在模拟(使用最小起订量)和验证对 EventAggregator.PublishOnUIThread 的调用时遇到问题,因为它是一种扩展方法!

查看源代码让我想出了另一个可模拟的方法调用:-)

但是如果知道 EventAggregator.Publish(aMessage,Execute.OnUIThread)等同于 EventAggregator.PublishOnUIThread(aMessage)?

最佳答案

是的,它们是等价的。

EventAggregator.PublishOnUIThread 扩展方法目前是这样实现的:

public static void PublishOnUIThread(this IEventAggregator eventAggregator, object message)
{
eventAggregator.Publish(message, Execute.OnUIThread);
}

有关详细信息,请参阅 EventAggregatorExtensions.cs源代码。

关于caliburn.micro - EventAggregator.PublishOnUIThread(aMessage) 是否与 EventAggregator.Publish(aMessage,Execute.OnUIThread) 相同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25638296/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com