Browse Source

adding name of enum

master
Volker Birk 1 month ago
parent
commit
fa419594c5
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/gen_cs.ysl2

+ 4
- 4
src/gen_cs.ysl2 View File

@ -14,7 +14,7 @@ tstylesheet {
template "/enum"
||
import System;
using System;
namespace pEp {
enum «yml:CamelCase(@name)»
@ -23,14 +23,14 @@ tstylesheet {
}
`` apply "item", mode=exception
class UnknownErrorException : Exception { }
class UnknownTSCErrorException : Exception { }
class «yml:CamelCase(@name)»Converter {
public static void throwTSCError(TransportStatusCode tsc) {
switch (tsc) {
``apply "item", 4, mode=case
default:
throw new UnknownErrorException();
throw new UnknownTSCErrorException();
}
}
}
@ -58,7 +58,7 @@ tstylesheet {
}
template "item", mode=case {
| case «yml:CamelCase(@name)»:
| case TransportStatusCode.«yml:CamelCase(@name)»:
const "isError" call "isError" with "tsc", ".";
choose {
when "$isError > 127"


Loading…
Cancel
Save