Dmitry Barsukov

Bug in conversion of For cycle

C# original:
List<string> values = new List<string>(value.Split(' '));
// Filter empty
for (int i = 0; i < values.Count; ++i)
if (values[i].Trim().Length == 0)

VB.NET conversion:
Dim values As New List(Of String)(value.Split(" "C))
' Filter empty
For i As Integer = 0 To values.Count - 1
If values(i).Trim().Length = 0 Then
i -= 1
End If
This is not correct: VB.NET does not check values.Count on every iteration. That why conversion is not correct
Problem by Dmitry Barsukov Status: Not Done Comments: 0 Last update: 2015-05-11T12:58:10 by Dmitry Barsukov
Amit Valentine

Method with no Attribute

When I tried to convert from to C# an problem occurred that I had to solve by typing. Allows you to call methods without parenthesis .
SomeString.Trim is correct for but in C# it must be SomeString.Trim()
This converter does not add those brackets.
I hope Telerik will have a look on this problem.
And thanks for this awesome converter.
Problem by Amit Valentine Status: Not Done Comments: 0 Last update: 2015-04-17T21:42:16 by Amit Valentine
David Marcus

Incorrect conversion for String.Split and indexing of results

I have VB code:
Dim featureData() As String = Split(item, ":")
FeatureId = CInt(featureData(0))

The converted to C# code:
string[] featureData = Strings.Split(item, ":");
FeatureId = Convert.ToInt32(featureData(0));


1) For the String.Split it should have used
string[] featureData = item.Split(':');

2) it generated bad code (syntax error) for the second line, should be
FeatureId = Convert.ToInt32(featureData[0]);

Note the incorrect use of parenthesis which should have been braces (for the subscript reference).

Better yet, it could have used int.Parse(featureData[0]);
Feedback by David Marcus Status: Not Done Comments: 0 Last update: 2015-04-07T16:51:14 by David Marcus
garima sah

vb to javascipt

Feedback by garima sah Status: Not Done Comments: 0 Attachments: 1 Last update: 2015-04-03T10:04:17 by garima sah
Víctor Lara Santillán

Concatenating strings

When using c# I used:
string test = "1";
test = "1" + "2"; // test should be 12;

In VB translation it gives:
test = "1" + "2";

this should be:
test = "1" & "2";
Feedback by Víctor Lara Santillán Status: Not Done Comments: 0 Last update: 2015-02-18T14:51:21 by Víctor Lara Santillán
Serkan Güncan

cursor , ico

Bitmap bmp = new Bitmap("sineklik.png");
ico == Icon.FromHandle(bmp.GetHicon); ---> why does it make mistakes?
customCursor = new Cursor(ico.Handle);
this.UseWaitCursor = false;
this.Cursor = customCursor;
Problem by Serkan Güncan Status: Not Done Comments: 0 Last update: 2015-02-16T12:44:41 by Serkan Güncan
Steve Florence

C# event handlers not converting correctly - problem still exists

Converting this simple code, the converter incorrectly converts this:
cbo.Validating += new CancelEventHandler(cbo_Validating);
as this
cbo.Validating += New CancelEventHandler(cbo_Validating)
All it did was to remove the ";"

It should have returned the VB code as:
AddHandler cbo.Validating, AddressOf Me.cbo_Validating

The odd part is that sometimes this converter gets it right.

Snippet trying to convert:
void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
if (e.Control.GetType() == typeof(DataGridViewComboBoxEditingControl))
DataGridViewComboBoxEditingControl cbo = e.Control as DataGridViewComboBoxEditingControl;
cbo.DropDownStyle = ComboBoxStyle.DropDown;
cbo.Validating += new CancelEventHandler(cbo_Validating);
Feedback by Steve Florence Status: Not Done Comments: 0 Last update: 2015-02-03T19:14:19 by Steve Florence
Steve Florence

eventhandler code conversion error

C# Input:
this.Layout += new System.Windows.Forms.LayoutEventHandler(this.ComboBoxTree_Layout);

VB.NET Ouput:
Me.Layout += New System.Windows.Forms.LayoutEventHandler(Me.ComboBoxTree_Layout)

VB.NET ouput should be:
AddHandler Layout, AddressOf Me.ComboBoxTree_Layout
Feedback by Steve Florence Status: Not Done Comments: 0 Last update: 2015-01-16T17:19:48 by Steve Florence
Joe Farrell

Implicit variable type changes from C# to VB.NET

C# Input:
var x = 5 / 3;

Actual VB.NET Output:
Dim x = 5 / 3

Suggested VB.NET Output:
Dim x = 5 \ 3

The C# code declares an int whose value is 1. The VB.NET code currently generated by the converter declares a double whose value is 1.6666667.
Feedback by Joe Farrell Status: Not Done Comments: 2 Last update: 2015-01-13T17:51:37 by Joe Farrell
Steve Florence

lambda expression

When will this converter have the ability to convert lambda code?
Tried this:

protected override void OnStart(string[] args)
EventLogger.Write("Starting service!");
ThreadPool.QueueUserWorkItem( _ => {
new VirtualServerInit(EventLogger).Run();
EventLogger.Write("VirtualServerInit code was executed");

and it failed
Feedback by Steve Florence Status: Not Done Comments: 0 Last update: 2015-01-07T17:25:04 by Steve Florence
Displaying items 51 - 60 of 87