【发布时间】:2010-11-07 23:47:27
【问题描述】:
我目前正在开发一个使用 AutoFac Inversion of Control 容器的项目。
我正在尝试将一些示例代码从 C# 转换为我现有项目的代码库,该项目是用 VB.NET 编写的,但我遇到了问题。
原来的代码行是:
EventHub.Subscribe<HandshakingEvent>(container.Resolve<HandshakeAuthenticator>().CheckHandshake);
我已转换为:
EventHub.Subscribe(Of HandshakingEvent)(Container.Resolve(Of HandshakeAuthenticator)().CheckHandshake)
但是 - 这会导致错误,“Argument not specified for parameter 'ev' of CheckHandshake”。
EventHub.Subscribe(Of HandshakingEvent)过程的参数类型是System.Action(of HandshakingEvent)
我可以看到问题所在,但我真的不知道该怎么办!我尝试过使用“AddressOf”,但这似乎也不起作用。
提前谢谢... - 克里斯
【问题讨论】:
-
CheckHandshake是什么?
标签: c# vb.net c#-to-vb.net