我对这个声明很愚蠢....也许它只是将 C# 转换为 VB.Net 花费了太多小时/天,但我对这种转换一无所知。
如有任何帮助,我们将不胜感激。
List<string> sColors = new List<string>(this.CustomPaletteValues.Split(','));
try {
List<Color> colors = sColors.ConvertAll<Color>(s => (Color)(new ColorConverter().ConvertFromString(s)));
到目前为止我有什么:
Dim colors As List(Of Color) = sColors.ConvertAll(Of Color)(....)
如您所见,它是 lambda 的内容,我正在用它撞墙。
最佳答案
请原谅换行,但我相信这就是您想要的。
Dim colors As List(Of Color) = sColors.ConvertAll(Of Color)(
Function(s) DirectCast((New ColorConverter).ConvertFromString(s), Color)
)
关于c# - Lambda 表达式 : CS to VB. 网络,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7182998/