在物理庫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