Skip to content

Commit cfbf44b

Browse files
committed
added generic
1 parent 7a744e5 commit cfbf44b

File tree

5 files changed

+86
-5
lines changed

5 files changed

+86
-5
lines changed

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ variables:
1010
solution: '**/*.sln'
1111
buildPlatform: 'Any CPU'
1212
buildConfiguration: 'Release'
13-
deployNuget: '1'
13+
deployNuget: '0'
1414

1515
steps:
1616
- task: NuGetToolInstaller@1

changelog.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated with
66

7-
git --no-pager log --pretty=format:"%n #### [%s] %n Author %an on %ai %n%n hash %h %H" 1.1.2020.25553965..1.1.2020.27535073
7+
git --no-pager log --pretty=format:"%n #### [%s] %n Author %an on %ai %n%n hash %h %H" 1.1.2020.27535073..1.1.2020.27897354
88

99
More details at
1010
http://msprogrammer.serviciipeweb.ro/2020/06/15/poor-software-developer-simple-changelog-for-cd/
1111

12+
## 1.1.2020.27897354 - generate from inside class
13+
14+
#### [generating values inside class]
15+
Author ignatandrei on 2020-11-18 23:13:59 +0200
16+
1217
## 1.1.2020.27535073 debugger + download/upload blocks definitions
1318

1419
#### [download files on local]

src/NetCore2Blockly/NetCore2Blockly/TypeToGenerateFromCSharp.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ public override string TypeNameForBlockly
8383
{
8484

8585
var type = Nullable.GetUnderlyingType(t) ?? t;
86-
return type.Name;
86+
string typeName = type.Name;
87+
if (type.IsGenericType)
88+
{
89+
typeName = typeName.Replace("`", "_");
90+
}
91+
return typeName;
8792
}
8893
}
8994

src/NetCore2Blockly/TestBlocklyHtml/Controllers/VariousTestsController.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818

1919
namespace TestBlocklyHtml.Controllers
2020
{
21+
public class GenericsTest<T>
22+
{
23+
public T t { get; set; }
24+
}
25+
2126

2227
[Route("api/[controller]/[action]")]
2328
[ApiController]
@@ -28,15 +33,16 @@ public VariousTestsController()
2833
{
2934
}
3035

36+
3137
[HttpPost]
3238
public string TestInsideVariable(WithInsideClass id)
3339
{
3440
return "this is " + id.t.Ind + "=>" + id.t.a;
3541
}
3642
[HttpPost]
37-
public string TestInsideVariable1(WithInsideClass id)
43+
public string TestGeneric(GenericsTest<Test> id)
3844
{
39-
return "this is " + id.t.Ind + "=>" + id.t.a;
45+
return "this is " + id.t.Ind+ "=>" + id.t.a;
4046
}
4147

4248
[HttpGet("{name}")]

src/NetCore2Blockly/TestBlocklyHtml/wwwroot/doNotCopy/testing.js

+65
Original file line numberDiff line numberDiff line change
@@ -2862,6 +2862,71 @@ var testBlocks =
28622862
</block>
28632863
</next>
28642864
</block>
2865+
</xml>`
2866+
},
2867+
{
2868+
name: "generic",
2869+
data:`<xml xmlns="https://developers.google.com/blockly/xml">
2870+
<variables>
2871+
<variable id="Q|gzJurns)WU=N)C0oZ}">var_AnEnum</variable>
2872+
<variable id="qt^W83W?Bn+2_%*A*V+l">var_Test</variable>
2873+
<variable id="N]NaQUz7^al6M0L[DzFK">var_GenericsTest_1</variable>
2874+
</variables>
2875+
<block type="variables_set" x="68" y="102">
2876+
<field name="VAR" id="Q|gzJurns)WU=N)C0oZ}">var_AnEnum</field>
2877+
<value name="VALUE">
2878+
<block type="TestBlocklyHtml_Controllers_AnEnum">
2879+
<field name="val_AnEnum">1</field>
2880+
</block>
2881+
</value>
2882+
<next>
2883+
<block type="variables_set">
2884+
<field name="VAR" id="qt^W83W?Bn+2_%*A*V+l">var_Test</field>
2885+
<value name="VALUE">
2886+
<block type="TestBlocklyHtml_Controllers_Test">
2887+
<value name="val_Ind">
2888+
<shadow type="text">
2889+
<field name="TEXT">asdads</field>
2890+
</shadow>
2891+
</value>
2892+
<value name="val_a">
2893+
<block type="variables_get">
2894+
<field name="VAR" id="Q|gzJurns)WU=N)C0oZ}">var_AnEnum</field>
2895+
</block>
2896+
</value>
2897+
</block>
2898+
</value>
2899+
<next>
2900+
<block type="variables_set">
2901+
<field name="VAR" id="N]NaQUz7^al6M0L[DzFK">var_GenericsTest_1</field>
2902+
<value name="VALUE">
2903+
<block type="TestBlocklyHtml_Controllers_GenericsTest\`1[[TestBlocklyHtml_Controllers_Test, TestBlocklyHtml, Version=1_0_0_0, Culture=neutral, PublicKeyToken=null]]">
2904+
<value name="val_t">
2905+
<block type="variables_get">
2906+
<field name="VAR" id="qt^W83W?Bn+2_%*A*V+l">var_Test</field>
2907+
</block>
2908+
</value>
2909+
</block>
2910+
</value>
2911+
<next>
2912+
<block type="text_print">
2913+
<value name="TEXT">
2914+
<block type="api_VariousTests_TestGeneric_POST">
2915+
<value name="val_id">
2916+
<shadow type="TestBlocklyHtml_Controllers_GenericsTest\`1[[TestBlocklyHtml_Controllers_Test, TestBlocklyHtml, Version=1_0_0_0, Culture=neutral, PublicKeyToken=null]]"></shadow>
2917+
<block type="variables_get">
2918+
<field name="VAR" id="N]NaQUz7^al6M0L[DzFK">var_GenericsTest_1</field>
2919+
</block>
2920+
</value>
2921+
</block>
2922+
</value>
2923+
</block>
2924+
</next>
2925+
</block>
2926+
</next>
2927+
</block>
2928+
</next>
2929+
</block>
28652930
</xml>`
28662931
}
28672932
]

0 commit comments

Comments
 (0)