码迷,mamicode.com
首页 > Windows程序 > 详细

VB.NET转C#代码的工具

时间:2015-01-15 23:49:46      阅读:242      评论:0      收藏:0      [点我收藏+]

标签:

比如VB.NET的代码:

For Each prop In entity.Details.Properties.All().
        OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

        If prop.Name <> "Id" Then 
            If Not Object.Equals(prop.Value, prop.OriginalValue) Then 
                oldvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.OriginalValue)
                newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
            End If 
        End If 
   Next 

转为C#的代码:

foreach (var prop in entity.Details.Properties.All().OfType<Microsoft.LightSwitch.Details.IEntityStorageProperty>())
{
     
    if (prop.Name != "Id")
    {
        if (!object.Equals(prop.Value, prop.OriginalValue))
        {
            oldvals += string.Format("{0}{1}: {2}", "\r\n", prop.Name, prop.OriginalValue);
            newvals += string.Format("{0}{1}: {2}", "\r\n", prop.Name, prop.Value);
        }
    }
}

代码转换工具链接:http://www.ttrar.com/html/VBNet-to-C-Sharp-Converter.html#down


VB.NET转C#代码的工具

标签:

原文地址:http://blog.csdn.net/chinacsharper/article/details/42753245

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!