-
Notifications
You must be signed in to change notification settings - Fork 2
/
testresults.json
1 lines (1 loc) · 24.8 KB
/
testresults.json
1
[{"Name":"Cast","Description":"Cast operator","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\t[int]$myInt = 1\r\n\t[long]$myLong = [long]$myInt\r\n}","TargetContent":"void Method()\r\n{\r\n\tint myInt = 1;\r\n\tlong myLong = (long)myInt;\r\n}","Source":1,"Target":0},{"Name":"Switch","Description":"Switch statement","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\t[int]$i = 0\r\n\t[int]$x = 1\r\n\tswitch ($i)\r\n\t{\r\n\t\t2 { $x = 2 }\r\n\t\t3 { $x = 3 }\r\n\t\tdefault { }\r\n\t}\r\n}","TargetContent":"void Method()\r\n{\r\n\tint i = 0;\r\n\tint x = 1;\r\n\tswitch (i)\r\n\t{\r\n\t\tcase 2:\r\n\t\t\tx = 2;\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tx = 3;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t}\r\n}","Source":1,"Target":0},{"Name":"AssignVariable","Description":"Assign a constant to a variable","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\t[int]$variable = 1\r\n\t[string]$variable2 = \"myString\"\r\n}","TargetContent":"void Method()\r\n{\r\n\tint variable = 1;\r\n\tstring variable2 = \"myString\";\r\n}","Source":1,"Target":0},{"Name":"StaticMethod","Description":"Static method","Category":"Syntax","SourceContent":"function Method()\r\n{\r\n\t[Guid]::New()\r\n}","TargetContent":"void Method()\r\n{\r\n\tGuid.New();\r\n}","Source":1,"Target":0},{"Name":"PropertyAccess","Description":"Access the property of a variable","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\t[TimeZoneInfo]$timeZoneInfo = New-Object -TypeName TimeZoneInfo\r\n\t[string]$variable = $timeZoneInfo.DisplayName\r\n}","TargetContent":"void Method()\r\n{\r\n\tTimeZoneInfo timeZoneInfo = new TimeZoneInfo();\r\n\tstring variable = timeZoneInfo.DisplayName;\r\n}","Source":1,"Target":0},{"Name":"Operators","Description":"Common operators","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\t[bool]$eq = 1 -eq 2\r\n\t[bool]$notEq = 1 -ne 2\r\n\t[bool]$or = 1 -eq 2 -or 2 -eq 1\r\n\t[bool]$and = 1 -eq 2 -and 2 -eq 1\r\n\t[bool]$gt = 1 -gt 2\r\n\t[bool]$lt = 1 -lt 2\r\n\t[bool]$ge = 1 -ge 2\r\n\t[bool]$le = 1 -le 2\r\n\t[int]$plus = 1 + 1\r\n\t[int]$minus = 1 - 1\r\n\t[int]$bor = 1 -bor 1\r\n}","TargetContent":"void Method()\r\n{\r\n\tbool eq = 1 == 2;\r\n\tbool notEq = 1 != 2;\r\n\tbool or = 1 == 2 || 2 == 1;\r\n\tbool and = 1 == 2 && 2 == 1;\r\n\tbool gt = 1 > 2;\r\n\tbool lt = 1 < 2;\r\n\tbool ge = 1 >= 2;\r\n\tbool le = 1 <= 2;\r\n\tint plus = 1 + 1;\r\n\tint minus = 1 - 1;\r\n\tint bor = 1 | 1;\r\n}","Source":1,"Target":0},{"Name":"Return","Description":"Return statement","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\treturn 1\r\n}","TargetContent":"void Method()\r\n{\r\n\treturn 1;\r\n}","Source":1,"Target":0},{"Name":"PropertyAccess","Description":"Access the property of a variable","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class PropertyAccess\r\n {\r\n public void Method()\r\n {\r\n var timeZoneInfo = new TimeZoneInfo();\r\n var variable = timeZoneInfo.DisplayName;\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\t$timeZoneInfo = (New-Object -TypeName TimeZoneInfo)\r\n\t$variable = $timeZoneInfo.DisplayName\r\n}","Source":0,"Target":1},{"Name":"Throw","Description":"Throw statement","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\tthrow (New-Object -TypeName Exception -ArgumentList \"Hey\")\r\n}","TargetContent":"void Method()\r\n{\r\n\tthrow (new Exception(\"Hey\"));\r\n}","Source":1,"Target":0},{"Name":"MethodDeclaration","Description":"Declare a method","Category":"Syntax","SourceContent":"function Method\r\n{\r\n}","TargetContent":"void Method()\r\n{\r\n}","Source":1,"Target":0},{"Name":"MethodDeclarationWithArguments","Description":"Declare a method with arguments","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\tparam([string]$argument, [int]$integer)\r\n}","TargetContent":"void Method(String argument, Int32 integer)\r\n{\r\n}","Source":1,"Target":0},{"Name":"ObjectCreation","Description":"Create an object","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\tNew-Object -TypeName System.Object\r\n\tNew-Object System.Object\r\n}","TargetContent":"void Method()\r\n{\r\n\tnew System.Object();\r\n\tnew System.Object();\r\n}","Source":1,"Target":0},{"Name":"WriteHost","Description":"Write-Host to Console.WriteLine","Category":"Cmdlets","SourceContent":"function Method\r\n{\r\n\tWrite-Host -Object \"Hello, World!\"\r\n\tWrite-Host \"Hello, World!\"\r\n}","TargetContent":"void Method()\r\n{\r\n\tConsole.WriteLine(\"Hello, World!\");\r\n\tConsole.WriteLine(\"Hello, World!\");\r\n}","Source":1,"Target":0},{"Name":"If","Description":"If, Else If, Else","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\tif (1 -eq 2)\r\n\t{\r\n\t\t[int]$variable = 1;\r\n\t}\r\n\telseif (\"xyz\" -eq (New-Object -TypeName Object))\r\n\t{\r\n\t\t[int]$variable = 2;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t[int]$variable = 3;\r\n\t}\r\n}","TargetContent":"void Method()\r\n{\r\n\tif (1 == 2)\r\n\t{\r\n\t\tint variable = 1;\r\n\t}\r\n\telse if (\"xyz\" == (new Object()))\r\n\t{\r\n\t\tint variable = 2;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tint variable = 3;\r\n\t}\r\n}","Source":1,"Target":0},{"Name":"ObjectCreation","Description":"Create an object","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method()\r\n {\r\n new System.Object();\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\t(New-Object -TypeName System.Object)\r\n}","Source":0,"Target":1},{"Name":"If","Description":"If, Else If, Else","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method()\r\n {\r\n if (1 == 2)\r\n {\r\n\r\n }\r\n else if (\"xyz\" == (new Object()))\r\n {\r\n\r\n }\r\n else\r\n {\r\n\r\n }\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\tif (1 -eq 2)\r\n\t{\r\n\t}\r\n\telseif (\"xyz\" -eq ((New-Object -TypeName Object)))\r\n\t{\r\n\t}\r\n\telse\r\n\t{\r\n\t}\r\n}","Source":0,"Target":1},{"Name":"ObjectCreationWithArguments","Description":"Create an object with arugments","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method()\r\n {\r\n new System.Object(myVariable);\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\t(New-Object -TypeName System.Object -ArgumentList $myVariable)\r\n}","Source":0,"Target":1},{"Name":"AssignVariable","Description":"Assign a constant to a variable","Category":null,"SourceContent":"public void Method()\r\n{\r\n var variable = 1;\r\n\tvar variable = \"1\";\r\n}","TargetContent":"function Method\r\n{\r\n\t$variable = 1\r\n\t$variable = \"1\"\r\n}","Source":0,"Target":1},{"Name":"MethodDeclarationWithArguments","Description":"Declare a method with arguments","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method(string argument, int integer)\r\n {\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\tparam([string]$argument, [int]$integer)\r\n}","Source":0,"Target":1},{"Name":"While","Description":"While loop with break","Category":"Loops","SourceContent":"function Method\r\n{\r\n\twhile($true)\r\n\t{\r\n\t\tbreak\r\n\t}\r\n}","TargetContent":"void Method()\r\n{\r\n\twhile (true)\r\n\t{\r\n\t\tbreak;\r\n\t}\r\n}","Source":1,"Target":0},{"Name":"Cast","Description":"Cast operator","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method()\r\n {\r\n var myInt = 1;\r\n var myLong = (long)myInt;\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\t$myInt = 1\r\n\t$myLong = [long]$myInt\r\n}","Source":0,"Target":1},{"Name":"While","Description":"While loop with break","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method()\r\n {\r\n while (true)\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\twhile ($true)\r\n\t{\r\n\t\tbreak\r\n\t}\r\n}","Source":0,"Target":1},{"Name":"WriteFile","Description":"Out-File to File.WriteAllText","Category":"Cmdlets","SourceContent":"function Method()\r\n{\r\n\tOut-File -InputObject \"My output test\" -FilePath \"supersecretfile.txt\"\r\n\tOut-File \"supersecretfile.txt\" -InputObject \"My output test\" -Append\r\n\tAdd-Content -Value \"My output test\" -Path \"supersecretfile.txt\"\r\n}","TargetContent":"void Method()\r\n{\r\n\tFile.WriteAllText(\"supersecretfile.txt\",\"My output test\");\r\n\tFile.AppendAllText(\"supersecretfile.txt\",\"My output test\");\r\n\tFile.AppendAllText(\"supersecretfile.txt\",\"My output test\");\r\n}","Source":1,"Target":0},{"Name":"Return","Description":"Return statement","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public int Method()\r\n {\r\n return 1;\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\treturn 1\r\n}","Source":0,"Target":1},{"Name":"For","Description":"For loop","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method()\r\n {\r\n for(int i = 0; i < 100; i++)\r\n {\r\n var t = i;\r\n }\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\tfor([int]$i = 0; $i -lt 100; $i++)\r\n\t{\r\n\t\t$t = $i\r\n\t}\r\n}","Source":0,"Target":1},{"Name":"PInvokeSignature","Description":"Platform invoke signature","Category":null,"SourceContent":"[DllImport(\"advapi32.dll\", SetLastError = true)]\r\npublic static extern bool AbortSystemShutdown(string lpMachineName);\r\n\r\n[DllImport(\"credui\", CharSet = CharSet.Unicode)]\r\npublic static extern CredUIReturnCodes CredUIPromptForCredentialsW(ref CREDUI_INFO creditUR,\r\n string targetName,\r\n IntPtr reserved1,\r\n int iError,\r\n StringBuilder userName,\r\n int maxUserName,\r\n StringBuilder password,\r\n int maxPassword,\r\n [MarshalAs(UnmanagedType.Bool)] ref bool pfSave,\r\n CREDUI_FLAGS flags);","TargetContent":"function AbortSystemShutdown\r\n{\r\n\tparam([string]$lpMachineName)\r\n\tAdd-Type -TypeDefinition '\r\n\t\tusing System;\r\n\t\tusing System.Runtime.InteropServices;\r\n\t\tpublic static class PInvoke {\r\n\t\t\t[DllImport(\"advapi32.dll\", SetLastError = true)]\r\n\t\t\tpublic static extern bool AbortSystemShutdown(string lpMachineName);\r\n\t\t}\r\n\t'\r\n\t[PInvoke]::AbortSystemShutdown($lpMachineName)\r\n}\r\n\r\nfunction CredUIPromptForCredentialsW\r\n{\r\n\tparam([ref][CREDUI_INFO]$creditUR, [string]$targetName, [IntPtr]$reserved1, [int]$iError, [StringBuilder]$userName, [int]$maxUserName, [StringBuilder]$password, [int]$maxPassword, [ref][bool]$pfSave, [CREDUI_FLAGS]$flags)\r\n\tAdd-Type -TypeDefinition '\r\n\t\tusing System;\r\n\t\tusing System.Runtime.InteropServices;\r\n\t\tpublic static class PInvoke {\r\n\t\t\t[DllImport(\"credui\", CharSet = CharSet.Unicode)]\r\n\t\t\tpublic static extern CredUIReturnCodes CredUIPromptForCredentialsW(ref CREDUI_INFO creditUR,\r\n\t\t\tstring targetName,\r\n\t\t\tIntPtr reserved1,\r\n\t\t\tint iError,\r\n\t\t\tStringBuilder userName,\r\n\t\t\tint maxUserName,\r\n\t\t\tStringBuilder password,\r\n\t\t\tint maxPassword,\r\n\t\t\t[MarshalAs(UnmanagedType.Bool)] ref bool pfSave,\r\n\t\t\tCREDUI_FLAGS flags);\r\n\t\t}\r\n\t'\r\n\t[PInvoke]::CredUIPromptForCredentialsW([ref]$creditUR, $targetName, $reserved1, $iError, $userName, $maxUserName, $password, $maxPassword, [ref]$pfSave, $flags)\r\n}","Source":0,"Target":1},{"Name":"For","Description":"For loop","Category":"Loops","SourceContent":"function Method\r\n{\r\n\tfor([int]$i = 0; $i -lt 100; $i++)\r\n\t{\r\n\t\t[int]$t = $i\r\n\t}\r\n}","TargetContent":"void Method()\r\n{\r\n\tfor(int i = 0; i < 100; i++)\r\n\t{\r\n\t\tint t = i;\r\n\t}\r\n}","Source":1,"Target":0},{"Name":"Foreach","Description":"Foreach loop","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method(string[] strings)\r\n {\r\n foreach(var item in strings)\r\n {\r\n var str = item;\r\n continue;\r\n }\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\tparam([string[]]$strings)\r\n\tforeach ($item in $strings)\r\n\t{\r\n\t\t$str = $item\r\n\t\tcontinue\r\n\t}\r\n}","Source":0,"Target":1},{"Name":"Indexer","Description":"Indexer property","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\tparam([string]$str)\r\n\t[string]$item = $str[3]\r\n}","TargetContent":"void Method(String str)\r\n{\r\n\tstring item = str[3];\r\n}","Source":1,"Target":0},{"Name":"Using","Description":"Using statement","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method()\r\n {\r\n using (AesManaged aes = new AesManaged())\r\n {\r\n aes.Padding = PaddingMode.PKCS7;\r\n aes.KeySize = 128;\r\n aes.Key = key;\r\n aes.IV = IV;\r\n }\r\n }\r\n\r\n public void Method2()\r\n {\r\n var obj = new object();\r\n using (obj)\r\n {\r\n aes.Padding = PaddingMode.PKCS7;\r\n aes.KeySize = 128;\r\n aes.Key = key;\r\n aes.IV = IV;\r\n }\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\t[AesManaged]$aes = $null\r\n\ttry\r\n\t{\r\n\t\t$aes = (New-Object -TypeName AesManaged)\r\n\t\t$aes.Padding = $PaddingMode.PKCS7\r\n\t\t$aes.KeySize = 128\r\n\t\t$aes.Key = $key\r\n\t\t$aes.IV = $IV\r\n\t}\r\n\tfinally\r\n\t{\r\n\t\t$aes.Dispose()\r\n\t}\r\n}\r\nfunction Method2\r\n{\r\n\t$obj = (New-Object -TypeName object)\r\n\ttry\r\n\t{\r\n\t\t$aes.Padding = $PaddingMode.PKCS7\r\n\t\t$aes.KeySize = 128\r\n\t\t$aes.Key = $key\r\n\t\t$aes.IV = $IV\r\n\t}\r\n\tfinally\r\n\t{\r\n\t\t$obj.Dispose()\r\n\t}\r\n}","Source":0,"Target":1},{"Name":"Foreach","Description":"Foreach loop","Category":"Loops","SourceContent":"function Method\r\n{\r\n\tparam([string[]]$strings)\r\n\tforeach($item in $strings)\r\n\t{\r\n\t\t[string]$str = $item\r\n\t\tcontinue\r\n\t}\r\n}","TargetContent":"void Method(String[] strings)\r\n{\r\n\tforeach (var item in strings)\r\n\t{\r\n\t\tstring str = item;\r\n\t\tcontinue;\r\n\t}\r\n}","Source":1,"Target":0},{"Name":"Operators","Description":"Common operators","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method()\r\n {\r\n var eq = 1 == 2;\r\n var notEq = 1 != 2;\r\n var or = 1 == 2 || 2 == 1;\r\n var and = 1 == 2 && 2 == 1;\r\n var gt = 1 > 2;\r\n var lt = 1 < 2;\r\n var ge = 1 >= 2;\r\n var le = 1 <= 2;\r\n var plus = 1 + 1;\r\n var minus = 1 - 1;\r\n var bor = 1 | 1;\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\t$eq = 1 -eq 2\r\n\t$notEq = 1 -ne 2\r\n\t$or = 1 -eq 2 -or 2 -eq 1\r\n\t$and = 1 -eq 2 -and 2 -eq 1\r\n\t$gt = 1 -gt 2\r\n\t$lt = 1 -lt 2\r\n\t$ge = 1 -ge 2\r\n\t$le = 1 -le 2\r\n\t$plus = 1 + 1\r\n\t$minus = 1 - 1\r\n\t$bor = 1 -bor 1\r\n}","Source":0,"Target":1},{"Name":"Switch","Description":"Switch statement","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n void Method()\r\n {\r\n int i = 0;\r\n int x = 1;\r\n switch (i)\r\n {\r\n case 2:\r\n x = 2;\r\n break;\r\n case 3:\r\n x = 3;\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\t[int]$i = 0\r\n\t[int]$x = 1\r\n\tswitch ($i)\r\n\t{\r\n\t\t2 {\r\n\t\t\t$x = 2\r\n\t\t\t\r\n\t\t}\r\n\t\t3 {\r\n\t\t\t$x = 3\r\n\t\t\t\r\n\t\t}\r\n\t\tdefault {\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n}","Source":0,"Target":1},{"Name":"ArrayCreation","Description":"Array creation initializers","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method()\r\n {\r\n var arr = new string[] { \"my\", \"strings\" };\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\t$arr = @(\"my\",\"strings\")\r\n}","Source":0,"Target":1},{"Name":"ArrayCreation","Description":"Array creation initializers","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\t[string[]]$arr = @(\"my\",\"strings\")\r\n}","TargetContent":"void Method()\r\n{\r\n\tstring[] arr = new [] { \"my\", \"strings\" };\r\n}","Source":1,"Target":0},{"Name":"TryCatchFinally","Description":"Try, catch, finally","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method()\r\n {\r\n try\r\n {\r\n var item = new object();\r\n }\r\n catch (Exception ex)\r\n {\r\n var item = new object();\r\n }\r\n catch\r\n {\r\n var item = new object();\r\n }\r\n finally\r\n {\r\n var item = new object();\r\n }\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\ttry\r\n\t{\r\n\t\t$item = (New-Object -TypeName object)\r\n\t}\r\n\tcatch [Exception]\r\n\t{\r\n\t\t$item = (New-Object -TypeName object)\r\n\t}\r\n\tcatch\r\n\t{\r\n\t\t$item = (New-Object -TypeName object)\r\n\t}\r\n\tfinally\r\n\t{\r\n\t\t$item = (New-Object -TypeName object)\r\n\t}\r\n}","Source":0,"Target":1},{"Name":"TryCatchFinally","Description":"Try, catch, finally","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\ttry\r\n\t{\r\n\t\t$item = New-Object -TypeName object\r\n\t}\r\n\tcatch [Exception]\r\n\t{\r\n\t\t$item = New-Object -TypeName object\r\n\t}\r\n\tcatch\r\n\t{\r\n\t\t$item = New-Object -TypeName object\r\n\t}\r\n\tfinally\r\n\t{\r\n\t\t$item = New-Object -TypeName object\r\n\t}\r\n}","TargetContent":"void Method()\r\n{\r\n\ttry\r\n\t{\r\n\t\titem = new object();\r\n\t}\r\n\tcatch (Exception)\r\n\t{\r\n\t\titem = new object();\r\n\t}\r\n\tcatch\r\n\t{\r\n\t\titem = new object();\r\n\t}\r\n\tfinally\r\n\t{\r\n\t\titem = new object();\r\n\t}\r\n}","Source":1,"Target":0},{"Name":"Throw","Description":"Throw statement","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Throw\r\n {\r\n public void Method()\r\n {\r\n throw new Exception(\"Hey\");\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\tthrow (New-Object -TypeName Exception -ArgumentList \"Hey\")\r\n}","Source":0,"Target":1},{"Name":"GetProcess","Description":"Get-Process to Process","Category":"Cmdlets","SourceContent":"Get-Process\r\nGet-Process -Name \"myProcess\"\r\nGet-Process -Id 1","TargetContent":"System.Diagnostics.Process.GetProcesses();\r\nSystem.Diagnostics.Process.GetProcessesByName(\"myProcess\");\r\nSystem.Diagnostics.Process.GetProcessById(1);","Source":1,"Target":0},{"Name":"IncompleteCodeBlock","Description":"Converts an incomplete code block successfully.","Category":null,"SourceContent":"listView1.Items.Add(new ListViewItem(new string[]{\"1\", \"content\"}));\nlistView1.Items.Add(new ListViewItem(new string[]{\"4\", \"content2\"}));\nlistView1.Items.Add(new ListViewItem(new string[]{\"2\", \"content3\"}));","TargetContent":"function Method\r\n{\r\n\t$listView1.Items.Add((New-Object -TypeName ListViewItem -ArgumentList @(\"1\",\"content\")))\r\n\t$listView1.Items.Add((New-Object -TypeName ListViewItem -ArgumentList @(\"4\",\"content2\")))\r\n\t$listView1.Items.Add((New-Object -TypeName ListViewItem -ArgumentList @(\"2\",\"content3\")))\r\n}","Source":0,"Target":1},{"Name":"Indexer","Description":"Indexer property","Category":null,"SourceContent":"using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method(string str)\r\n {\r\n var item = str[3];\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n\tparam([string]$str)\r\n\t$item = $str[3]\r\n}","Source":0,"Target":1},{"Name":"StartProcess","Description":"Start-Process to Process.Start","Category":"Cmdlets","SourceContent":"function Method\r\n{\r\n\tStart-Process -FilePath \"notepad.exe\" -ArgumentList \"myText.txt\"\r\n\tStart-Process \"notepad.exe\" -ArgumentList \"myText.txt\"\r\n}","TargetContent":"void Method()\r\n{\r\n\tProcess process = new Process();\r\n\tProcessStartInfo startInfo = new ProcessStartInfo();\r\n\tstartInfo.FileName = \"notepad.exe\";\r\n\tstartInfo.Arguments = \"myText.txt\";\r\n\tprocess.StartInfo = startInfo;\r\n\tprocess.Start();\r\n\t;\r\n\tProcess process = new Process();\r\n\tProcessStartInfo startInfo = new ProcessStartInfo();\r\n\tstartInfo.FileName = \"notepad.exe\";\r\n\tstartInfo.Arguments = \"myText.txt\";\r\n\tprocess.StartInfo = startInfo;\r\n\tprocess.Start();\r\n\t;\r\n}","Source":1,"Target":0},{"Name":"MethodDeclaration","Description":"Declare a method","Category":null,"SourceContent":"namespace CodeConverter.Test.Languages.CSharp\r\n{\r\n public class Class\r\n {\r\n public void Method()\r\n {\r\n }\r\n }\r\n}\r\n","TargetContent":"function Method\r\n{\r\n}","Source":0,"Target":1},{"Name":"Snippet","Description":"Declare a method outside of a class or namespace","Category":null,"SourceContent":"void Method()\r\n{\r\n\r\n}","TargetContent":"function Method\r\n{\r\n}","Source":0,"Target":1},{"Name":"ObjectCreationWithArguments","Description":"Create an object with arugments","Category":"Syntax","SourceContent":"function Method\r\n{\r\n\tNew-Object -TypeName System.Object -ArgumentList $myVariable\r\n}","TargetContent":"void Method()\r\n{\r\n\tnew System.Object(myVariable);\r\n}","Source":1,"Target":0}]