How can I convert this VB.NET code to C#?

How can I convert this VB.NET code to C#?

Private myImageMapCalculations As New clsImageMapCalculations(Sub(ex As Exception) UnhandledExceptionHandler())

Answers


Something like this should work :

private clsImageMapCalculations myImageMapCalculations = 
new clsImageMapCalculations((Exception ex) => UnhandledExceptionHandler());

The part that can create problems with a conversion tool is :

Sub(ex As Exception) UnhandledExceptionHandler()

that can be converted into a corresponding lambda expression in C# :

(Exception ex) => UnhandledExceptionHandler()

private clsImageMapCalculations myImageMapCalculations = new clsImageMapCalculations((Exception ex) => UnhandledExceptionHandler());

VB.NET to C# conversions can be done by convertion tools, for example see http://www.developerfusion.com/tools/convert/vb-to-csharp/


Need Your Help

Custom Google Maps styling for Android

android coding-style google-maps-api-3

This one is pretty out there, but I can't find any posts addressing it anywhere. For Google Maps API v3, you can add custom styling to the map elements:

JQuery validationEngine not working in WordPress page

jquery wordpress wordpress-plugin-dev jquery-validation-engine

I have a rather complicated form in a file I've named newuser.php. I am using a WordPress plugin that allows in post/page php to include the file inside a WordPress page (I'm using the Suffusion th...