Amit Valentine

Method with no Attribute

When I tried to convert from VB.net to C# an problem occurred that I had to solve by typing.
Vb.net Allows you to call methods without parenthesis .
Like
SomeString.Trim is correct for VB.net 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
0
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));

Notes:

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
0
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
0
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
0
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
0
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
0
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
0
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
0
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");
this.Stop();
};
}

and it failed
Feedback by Steve Florence Status: Not Done Comments: 0 Last update: 2015-01-07T17:25:04 by Steve Florence
0
David Perish

c# using statement with initializer won't convert, but VB to C# will work

This code will convert from VB to C#, but not vise-versa:

// C#
using (Obj x = new Obj {a == 1,b == 2}) {
Console.WriteLine(x);
}

' VB.Net
Using x As New Obj With { a = 1, b = 2}
Console.WriteLine(x)
End Using
Problem by David Perish Status: Not Done Comments: 0 Last update: 2014-12-19T15:31:03 by David Perish
0
Displaying items 41 - 50 of 76