在物理库C#编写的我有以下代码:翻译代表使用到VB
(在ContactManager.cs)
public delegate void PostSolveDelegate(Contact contact, ref ContactImpulse impulse);
public PostSolveDelegate PostSolve;
而使用该代码的示例是:
(在test.cs中)
public virtual void PostSolve(Contact contact, ref ContactImpulse impulse)
{
}
ContactManager.PostSolve += PostSolve;
我想这样做在VB。 (只是thandling委托,而不是声明)
我尝试这样做,但它不工作:
AddHandler ContactManager.PostSolve, AddressOf PostSolve
以下的作品,但只允许我有一个处理程序委托:
ContactManager.PostSolve = new PostSolveDelegate(AddressOf PostSolve)
有没有一种方法可以让我在第一部分代码中完成同样的事情?
谢谢!
标题有点混乱:这是从C#到VB,而不是相反,对不对? – 2010-04-01 02:17:32
您能向我们展示“PostSolve”声明吗? – 2010-04-01 02:36:50
编辑显示声明,并为我编辑标题:)谢谢! – 2010-04-01 11:00:35