@@ -7,6 +7,7 @@ This Source Code Form is subject to the terms of the
77
88using System ;
99using OneScript . Contexts . Enums ;
10+ using OneScript . StandardLibrary . XMLSchema . Enumerations ;
1011using OneScript . Types ;
1112using ScriptEngine . Machine . Contexts ;
1213
@@ -18,35 +19,28 @@ public class ConsoleColorEnum : ClrEnumWrapper<ConsoleColor>
1819 private ConsoleColorEnum ( TypeDescriptor typeRepresentation , TypeDescriptor valuesType )
1920 : base ( typeRepresentation , valuesType )
2021 {
22+ this . WrapClrValue ( "Черный" , "Black" , ConsoleColor . Black ) ;
23+ this . WrapClrValue ( "ТемноСиний" , "DarkBlue" , ConsoleColor . DarkBlue ) ;
24+ this . WrapClrValue ( "ТемноЗеленый" , "DarkGreen" , ConsoleColor . DarkGreen ) ;
25+ this . WrapClrValue ( "ТемноБирюзовый" , "DarkCyan" , ConsoleColor . DarkCyan ) ;
26+ this . WrapClrValue ( "ТемноКрасный" , "DarkRed" , ConsoleColor . DarkRed ) ;
27+ this . WrapClrValue ( "ТемноМалиновый" , "DarkMagenta" , ConsoleColor . DarkMagenta ) ;
28+ this . WrapClrValue ( "ТемноЖелтый" , "DarkYellow" , ConsoleColor . DarkYellow ) ;
29+ this . WrapClrValue ( "Серый" , "Gray" , ConsoleColor . Gray ) ;
30+
31+ this . WrapClrValue ( "ТемноСерый" , "DarkGray" , ConsoleColor . DarkGray ) ;
32+ this . WrapClrValue ( "Синий" , "Blue" , ConsoleColor . Blue ) ;
33+ this . WrapClrValue ( "Зеленый" , "Green" , ConsoleColor . Green ) ;
34+ this . WrapClrValue ( "Бирюза" , "Cyan" , ConsoleColor . Cyan ) ;
35+ this . WrapClrValue ( "Красный" , "Red" , ConsoleColor . Red ) ;
36+ this . WrapClrValue ( "Малиновый" , "Magenta" , ConsoleColor . Magenta ) ;
37+ this . WrapClrValue ( "Желтый" , "Yellow" , ConsoleColor . Yellow ) ;
38+ this . WrapClrValue ( "Белый" , "White" , ConsoleColor . White ) ;
2139 }
2240
2341 public static ConsoleColorEnum CreateInstance ( ITypeManager typeManager )
2442 {
25- var instance = EnumContextHelper . CreateClrEnumInstance < ConsoleColorEnum , ConsoleColor > (
26- typeManager ,
27- ( t , v ) => new ConsoleColorEnum ( t , v ) ) ;
28-
29- instance . WrapClrValue ( "Черный" , "Black" , ConsoleColor . Black ) ;
30- instance . WrapClrValue ( "ТемноСиний" , "DarkBlue" , ConsoleColor . DarkBlue ) ;
31- instance . WrapClrValue ( "ТемноЗеленый" , "DarkGreen" , ConsoleColor . DarkGreen ) ;
32- instance . WrapClrValue ( "ТемноБирюзовый" , "DarkCyan" , ConsoleColor . DarkCyan ) ;
33- instance . WrapClrValue ( "ТемноКрасный" , "DarkRed" , ConsoleColor . DarkRed ) ;
34- instance . WrapClrValue ( "ТемноМалиновый" , "DarkMagenta" , ConsoleColor . DarkMagenta ) ;
35- instance . WrapClrValue ( "ТемноЖелтый" , "DarkYellow" , ConsoleColor . DarkYellow ) ;
36- instance . WrapClrValue ( "Серый" , "Gray" , ConsoleColor . Gray ) ;
37-
38- instance . WrapClrValue ( "ТемноСерый" , "DarkGray" , ConsoleColor . DarkGray ) ;
39- instance . WrapClrValue ( "Синий" , "Blue" , ConsoleColor . Blue ) ;
40- instance . WrapClrValue ( "Зеленый" , "Green" , ConsoleColor . Green ) ;
41- instance . WrapClrValue ( "Бирюза" , "Cyan" , ConsoleColor . Cyan ) ;
42- instance . WrapClrValue ( "Красный" , "Red" , ConsoleColor . Red ) ;
43- instance . WrapClrValue ( "Малиновый" , "Magenta" , ConsoleColor . Magenta ) ;
44- instance . WrapClrValue ( "Желтый" , "Yellow" , ConsoleColor . Yellow ) ;
45- instance . WrapClrValue ( "Белый" , "White" , ConsoleColor . White ) ;
46-
47- OnInstanceCreation ( instance ) ;
48-
49- return instance ;
43+ return CreateInstance ( typeManager , ( t , v ) => new ConsoleColorEnum ( t , v ) ) ;
5044 }
5145 }
5246}
0 commit comments