如何将C#谓词转换为VB [英] How do I convert C# predicate to VB
问题描述
大家好,
我正在将C#代码转换为VB. C#代码在这里:
使用ICSharpCode.TextEditor [
Hi Everyone,
I''m converting C# code to VB. The C# code is here:
Using ICSharpCode.TextEditor[^]
In ICSharpCode.TextEditor TextEditorForm.cs there is following C# code.
private void menuGoToNextBookmark_Click(object sender, EventArgs e)
{
DoEditAction(ActiveEditor, new ICSharpCode.TextEditor.Actions.GotoNextBookmark
(bookmark => true));
}
如何将此GotoNextBookmark构造函数参数(谓词)转换为VB?我认为该谓词应转换为VB函数.但是,我不确定"bookmark => true"是什么意思,因为据我所知,BookMark类没有任何默认属性.
欢迎任何建议. (我是C#/VB中.net编程的新手)
问候,
t.makita
How do I convert this GotoNextBookmark constructor parameter (predicate) to VB? I think this predicate should be converted VB function. However I''m not sure what "bookmark=>true" means because the BookMark class does not have any default property as far as I see.
Any suggestions are welcome. (I''m new to .net programming in C#/VB)
Regards,
t.makita
推荐答案
Private Sub menuGoToNextBookmark_Click(sender As Object, e As EventArgs)
DoEditAction(ActiveEditor, New ICSharpCode.TextEditor.Actions.GotoNextBookmark(Function(bookmark) True))
End Sub
查看以下内容:将VB转换为C#或将C#转换为VB
Look at this: Convert VB to C# or C# to VB
如果您只是转换VB. NET到C#的方法,请尝试 http://www.developerfusion.com/tools/convert/vb-to- csharp/ [^ ]
If your just converting VB.NET to C# try this http://www.developerfusion.com/tools/convert/vb-to-csharp/[^]
您可以尝试这样的事情;
You could try something like this;
DoEditAction(ActiveEditor, ICSharpCode.TextEditor.Actions.GotoNextBookmark(Function(bookmark) True))
希望这会有所帮助,
弗雷德里克(Fredrik)
Hope this helps,
Fredrik
这篇关于如何将C#谓词转换为VB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!