CodeConverter
CodeConverter copied to clipboard
Convert code from C# to VB.NET and vice versa using Roslyn
### VB.Net input code ```vbnet Imports System Public Class A Public Shared Sub Main() Dim foo = 0.6 Dim bar = CInt(Math.Truncate(foo)) Dim baz = CInt(Math.Ceiling(foo)) Console.WriteLine(bar) Console.WriteLine(baz) End Sub...
### VB.Net input code ```vbnet Public Class ConversionTest3 Private Class MyEntity Property EntityId As Integer Property Name As String End Class Private Sub BugRepro() Dim entities As New List(Of MyEntity)...
### VB.Net input code Const value = &HFFFFFFFF value.Should.Be.EqualTo(-1) ### Erroneous output const int value = 0xFFFFFFFF; this doesn't compile (cannot convert uint to int) ### Expected output var value...
Possibly related to Issue #1012 ### VB.Net input code ```vbnet Public Class ConversionTest1 Public Sub BugRepro() Dim dt As New DataTable Parallel.ForEach(dt.AsEnumerable(), Nothing, Sub(row As DataRow) If Not String.IsNullOrWhiteSpace("") Then...
https://devblogs.microsoft.com/nuget/add-a-readme-to-your-nuget-package/ https://github.com/icsharpcode/ILSpy/blob/master/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj#L14
I just converted a WPF project from VB.NET to C#. There were a few basic transformations that had to be done manually. I want to describe them in this issue...
### Input code ```csharp private static string GetBaseForNewName(ISymbol declaration) { string name = GetName(declaration); return declaration.Kind switch { SymbolKind.Method => name + "Method", SymbolKind.Property => name + "Prop", SymbolKind.NamedType =>...
### VB.NET code ``` Imports System.Collections.Generic Imports System.Linq Class C Public Property MyString As String End Class Public Module Module1 Public Sub Main() Dim list As New List(Of C)() Dim...
### Input code ```csharp using System.Drawing; using System.Windows.Forms; class ConverterTests { public Color[] test1() { var textColor = Color.FromArgb(unchecked((int)0xFFCFCFCF)); var backColor = Color.FromArgb(unchecked((int)0xFF303030)); var altTextColor = Color.FromArgb(unchecked((int)0xFFFFFFFF)); var altBackColor =...