且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从C#转换为VB事件代码

更新时间:2023-02-16 20:39:30

删除分号。



有免费的在线转换工具 - 例如 Telerik [ ^ ](其中包括)



Remove the semi-colons.

There are free on-line converter tools available - e.g. Telerik[^] (amongst others)

CommSetting.comm.PhoneConnected -= New EventHandler(comm_PhoneConnected)
CommSetting.comm.MessageReceived -= New MessageReceivedEventHandler(comm_MessageReceived)

'=======================================================
'Service provided by Telerik (www.telerik.com)
'Conversion powered by NRefactory.
'Twitter: @telerik
'Facebook: facebook.com/telerik
'=======================================================





其他转换器 [ ^ ]



编辑 - 评论关于转换器仍然适用,但这就是为什么SA的解决方案2具有高度相关性。



删除处理程序:



A list of other converters[^]

Edit - Comments about the converters still apply, but this is why SA's solution 2 is highly relevant.

To remove a handler:

RemoveHandler CommSetting.comm.PhoneConnected, AddressOf comm_PhoneConnected
RemoveHandler CommSetting.comm.MessageReceived, AddressOf comm_MessageReceived


这不是转换;这是从一种语言到另一种语言的翻译。您可以使用在线工具自动翻译任何代码,或者更好的是,使用开源ILSpy将整个程序集转换为保证和高质量的离线。请参阅我以前的回答:代码解释,C#到VB .NET [ ^ ]。



-SA
This is not "convert"; this is translation from one language to another. You can translate any code automatically, using online tools, or, better yet, translate the whole assembly with the guarantee and good quality off-line, using open-source ILSpy. Please see my past answer: Code Interpretation, C# to VB.NET[^].

—SA