From 3e3461fe41e39ab5cb398bfade0744cb42a28eba Mon Sep 17 00:00:00 2001 From: Cedric Decoster Date: Wed, 31 Jul 2024 15:08:42 +0200 Subject: [PATCH] readded enum ext wrappers (#88) --- .../Model/Types/Base/BaseEnumExt.cs | 14525 +++- .../Model/Types/Base/BaseEnumExt2.cs | 57540 ++++++++++++++++ .../Model/Types/Base/BaseEnumExt3.cs | 8497 +++ Substrate.NetApi/Substrate.NetApi.csproj | 2 +- 4 files changed, 80310 insertions(+), 254 deletions(-) diff --git a/Substrate.NetApi/Model/Types/Base/BaseEnumExt.cs b/Substrate.NetApi/Model/Types/Base/BaseEnumExt.cs index 9b40dbf..e54be78 100644 --- a/Substrate.NetApi/Model/Types/Base/BaseEnumExt.cs +++ b/Substrate.NetApi/Model/Types/Base/BaseEnumExt.cs @@ -1024,7 +1024,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -1039,7 +1039,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -1087,7 +1086,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x0A: return DecodeType(byteArray, ref p); case 0x0B: return DecodeType(byteArray, ref p); case 0x0C: return DecodeType(byteArray, ref p); - case 0x0D: return DecodeType(byteArray, ref p); default: return null; } @@ -1122,7 +1120,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -1138,9 +1136,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -1189,9 +1184,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x0B: return DecodeType(byteArray, ref p); case 0x0C: return DecodeType(byteArray, ref p); case 0x0D: return DecodeType(byteArray, ref p); - case 0x0E: return DecodeType(byteArray, ref p); - case 0x0F: return DecodeType(byteArray, ref p); - case 0x10: return DecodeType(byteArray, ref p); default: return null; } @@ -1226,7 +1218,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -1243,10 +1235,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -1296,10 +1284,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x0C: return DecodeType(byteArray, ref p); case 0x0D: return DecodeType(byteArray, ref p); case 0x0E: return DecodeType(byteArray, ref p); - case 0x0F: return DecodeType(byteArray, ref p); - case 0x10: return DecodeType(byteArray, ref p); - case 0x11: return DecodeType(byteArray, ref p); - case 0x12: return DecodeType(byteArray, ref p); default: return null; } @@ -1334,7 +1318,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -1352,12 +1336,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -1408,12 +1386,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x0D: return DecodeType(byteArray, ref p); case 0x0E: return DecodeType(byteArray, ref p); case 0x0F: return DecodeType(byteArray, ref p); - case 0x10: return DecodeType(byteArray, ref p); - case 0x11: return DecodeType(byteArray, ref p); - case 0x12: return DecodeType(byteArray, ref p); - case 0x13: return DecodeType(byteArray, ref p); - case 0x14: return DecodeType(byteArray, ref p); - case 0x15: return DecodeType(byteArray, ref p); default: return null; } @@ -1448,7 +1420,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -1467,13 +1439,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -1525,13 +1490,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x0E: return DecodeType(byteArray, ref p); case 0x0F: return DecodeType(byteArray, ref p); case 0x10: return DecodeType(byteArray, ref p); - case 0x11: return DecodeType(byteArray, ref p); - case 0x12: return DecodeType(byteArray, ref p); - case 0x13: return DecodeType(byteArray, ref p); - case 0x14: return DecodeType(byteArray, ref p); - case 0x15: return DecodeType(byteArray, ref p); - case 0x16: return DecodeType(byteArray, ref p); - case 0x17: return DecodeType(byteArray, ref p); default: return null; } @@ -1566,7 +1524,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -1586,14 +1544,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -1646,14 +1596,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x0F: return DecodeType(byteArray, ref p); case 0x10: return DecodeType(byteArray, ref p); case 0x11: return DecodeType(byteArray, ref p); - case 0x12: return DecodeType(byteArray, ref p); - case 0x13: return DecodeType(byteArray, ref p); - case 0x14: return DecodeType(byteArray, ref p); - case 0x15: return DecodeType(byteArray, ref p); - case 0x16: return DecodeType(byteArray, ref p); - case 0x17: return DecodeType(byteArray, ref p); - case 0x18: return DecodeType(byteArray, ref p); - case 0x19: return DecodeType(byteArray, ref p); default: return null; } @@ -1688,7 +1630,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -1709,15 +1651,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -1771,15 +1704,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x10: return DecodeType(byteArray, ref p); case 0x11: return DecodeType(byteArray, ref p); case 0x12: return DecodeType(byteArray, ref p); - case 0x13: return DecodeType(byteArray, ref p); - case 0x14: return DecodeType(byteArray, ref p); - case 0x15: return DecodeType(byteArray, ref p); - case 0x16: return DecodeType(byteArray, ref p); - case 0x17: return DecodeType(byteArray, ref p); - case 0x18: return DecodeType(byteArray, ref p); - case 0x19: return DecodeType(byteArray, ref p); - case 0x1A: return DecodeType(byteArray, ref p); - case 0x1B: return DecodeType(byteArray, ref p); default: return null; } @@ -1814,7 +1738,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -1836,18 +1760,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -1902,18 +1814,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x11: return DecodeType(byteArray, ref p); case 0x12: return DecodeType(byteArray, ref p); case 0x13: return DecodeType(byteArray, ref p); - case 0x14: return DecodeType(byteArray, ref p); - case 0x15: return DecodeType(byteArray, ref p); - case 0x16: return DecodeType(byteArray, ref p); - case 0x17: return DecodeType(byteArray, ref p); - case 0x18: return DecodeType(byteArray, ref p); - case 0x19: return DecodeType(byteArray, ref p); - case 0x1A: return DecodeType(byteArray, ref p); - case 0x1B: return DecodeType(byteArray, ref p); - case 0x1C: return DecodeType(byteArray, ref p); - case 0x1D: return DecodeType(byteArray, ref p); - case 0x1E: return DecodeType(byteArray, ref p); - case 0x1F: return DecodeType(byteArray, ref p); default: return null; } @@ -1948,7 +1848,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -1971,19 +1871,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -2039,19 +1926,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x12: return DecodeType(byteArray, ref p); case 0x13: return DecodeType(byteArray, ref p); case 0x14: return DecodeType(byteArray, ref p); - case 0x15: return DecodeType(byteArray, ref p); - case 0x16: return DecodeType(byteArray, ref p); - case 0x17: return DecodeType(byteArray, ref p); - case 0x18: return DecodeType(byteArray, ref p); - case 0x19: return DecodeType(byteArray, ref p); - case 0x1A: return DecodeType(byteArray, ref p); - case 0x1B: return DecodeType(byteArray, ref p); - case 0x1C: return DecodeType(byteArray, ref p); - case 0x1D: return DecodeType(byteArray, ref p); - case 0x1E: return DecodeType(byteArray, ref p); - case 0x1F: return DecodeType(byteArray, ref p); - case 0x20: return DecodeType(byteArray, ref p); - case 0x21: return DecodeType(byteArray, ref p); default: return null; } @@ -2086,7 +1960,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -2110,22 +1984,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -2182,22 +2040,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x13: return DecodeType(byteArray, ref p); case 0x14: return DecodeType(byteArray, ref p); case 0x15: return DecodeType(byteArray, ref p); - case 0x16: return DecodeType(byteArray, ref p); - case 0x17: return DecodeType(byteArray, ref p); - case 0x18: return DecodeType(byteArray, ref p); - case 0x19: return DecodeType(byteArray, ref p); - case 0x1A: return DecodeType(byteArray, ref p); - case 0x1B: return DecodeType(byteArray, ref p); - case 0x1C: return DecodeType(byteArray, ref p); - case 0x1D: return DecodeType(byteArray, ref p); - case 0x1E: return DecodeType(byteArray, ref p); - case 0x1F: return DecodeType(byteArray, ref p); - case 0x20: return DecodeType(byteArray, ref p); - case 0x21: return DecodeType(byteArray, ref p); - case 0x22: return DecodeType(byteArray, ref p); - case 0x23: return DecodeType(byteArray, ref p); - case 0x24: return DecodeType(byteArray, ref p); - case 0x25: return DecodeType(byteArray, ref p); default: return null; } @@ -2232,7 +2074,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -2257,22 +2099,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -2330,22 +2156,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x14: return DecodeType(byteArray, ref p); case 0x15: return DecodeType(byteArray, ref p); case 0x16: return DecodeType(byteArray, ref p); - case 0x17: return DecodeType(byteArray, ref p); - case 0x18: return DecodeType(byteArray, ref p); - case 0x19: return DecodeType(byteArray, ref p); - case 0x1A: return DecodeType(byteArray, ref p); - case 0x1B: return DecodeType(byteArray, ref p); - case 0x1C: return DecodeType(byteArray, ref p); - case 0x1D: return DecodeType(byteArray, ref p); - case 0x1E: return DecodeType(byteArray, ref p); - case 0x1F: return DecodeType(byteArray, ref p); - case 0x20: return DecodeType(byteArray, ref p); - case 0x21: return DecodeType(byteArray, ref p); - case 0x22: return DecodeType(byteArray, ref p); - case 0x23: return DecodeType(byteArray, ref p); - case 0x24: return DecodeType(byteArray, ref p); - case 0x25: return DecodeType(byteArray, ref p); - case 0x26: return DecodeType(byteArray, ref p); default: return null; } @@ -2380,7 +2190,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -2406,22 +2216,6 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -2480,22 +2274,6 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x15: return DecodeType(byteArray, ref p); case 0x16: return DecodeType(byteArray, ref p); case 0x17: return DecodeType(byteArray, ref p); - case 0x18: return DecodeType(byteArray, ref p); - case 0x19: return DecodeType(byteArray, ref p); - case 0x1A: return DecodeType(byteArray, ref p); - case 0x1B: return DecodeType(byteArray, ref p); - case 0x1C: return DecodeType(byteArray, ref p); - case 0x1D: return DecodeType(byteArray, ref p); - case 0x1E: return DecodeType(byteArray, ref p); - case 0x1F: return DecodeType(byteArray, ref p); - case 0x20: return DecodeType(byteArray, ref p); - case 0x21: return DecodeType(byteArray, ref p); - case 0x22: return DecodeType(byteArray, ref p); - case 0x23: return DecodeType(byteArray, ref p); - case 0x24: return DecodeType(byteArray, ref p); - case 0x25: return DecodeType(byteArray, ref p); - case 0x26: return DecodeType(byteArray, ref p); - case 0x27: return DecodeType(byteArray, ref p); default: return null; } @@ -2530,7 +2308,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -2557,26 +2335,14095 @@ public class BaseEnumExt + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() where T42 : IType, new() where T43 : IType, new() where T44 : IType, new() where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() { /// public override string TypeName() => typeof(T0).Name; @@ -2656,6 +16503,59 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x2A: return DecodeType(byteArray, ref p); case 0x2B: return DecodeType(byteArray, ref p); case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); default: return null; } @@ -2690,7 +16590,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -2740,6 +16640,57 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -2822,6 +16773,57 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x2D: return DecodeType(byteArray, ref p); case 0x2E: return DecodeType(byteArray, ref p); case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); default: return null; } @@ -2856,7 +16858,7 @@ public void Create(T0 t, IType value2) public IType Value2 { get; set; } } /// - public class BaseEnumExt : BaseEnumType + public class BaseEnumExt : BaseEnumType where T0 : Enum where T1 : IType, new() where T2 : IType, new() @@ -2950,6 +16952,14 @@ public class BaseEnumExt public override string TypeName() => typeof(T0).Name; @@ -3076,6 +17086,14 @@ private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) case 0x59: return DecodeType(byteArray, ref p); case 0x5A: return DecodeType(byteArray, ref p); case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); default: return null; } @@ -3109,4 +17127,5 @@ public void Create(T0 t, IType value2) /// public IType Value2 { get; set; } } + } \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Base/BaseEnumExt2.cs b/Substrate.NetApi/Model/Types/Base/BaseEnumExt2.cs index 55f17bd..1dee48b 100644 --- a/Substrate.NetApi/Model/Types/Base/BaseEnumExt2.cs +++ b/Substrate.NetApi/Model/Types/Base/BaseEnumExt2.cs @@ -5,4 +5,57544 @@ namespace Substrate.NetApi.Model.Types.Base { + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } } \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Base/BaseEnumExt3.cs b/Substrate.NetApi/Model/Types/Base/BaseEnumExt3.cs index 18a36db..51e13d7 100644 --- a/Substrate.NetApi/Model/Types/Base/BaseEnumExt3.cs +++ b/Substrate.NetApi/Model/Types/Base/BaseEnumExt3.cs @@ -5,6 +5,8503 @@ namespace Substrate.NetApi.Model.Types.Base { + + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + where T245 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + case 0xF4: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + where T245 : IType, new() + where T246 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + case 0xF4: return DecodeType(byteArray, ref p); + case 0xF5: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + where T245 : IType, new() + where T246 : IType, new() + where T247 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + case 0xF4: return DecodeType(byteArray, ref p); + case 0xF5: return DecodeType(byteArray, ref p); + case 0xF6: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + + /* UNITY IL2CPP BUG + + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + where T245 : IType, new() + where T246 : IType, new() + where T247 : IType, new() + where T248 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + case 0xF4: return DecodeType(byteArray, ref p); + case 0xF5: return DecodeType(byteArray, ref p); + case 0xF6: return DecodeType(byteArray, ref p); + case 0xF7: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + where T245 : IType, new() + where T246 : IType, new() + where T247 : IType, new() + where T248 : IType, new() + where T249 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + case 0xF4: return DecodeType(byteArray, ref p); + case 0xF5: return DecodeType(byteArray, ref p); + case 0xF6: return DecodeType(byteArray, ref p); + case 0xF7: return DecodeType(byteArray, ref p); + case 0xF8: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + where T245 : IType, new() + where T246 : IType, new() + where T247 : IType, new() + where T248 : IType, new() + where T249 : IType, new() + where T250 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + case 0xF4: return DecodeType(byteArray, ref p); + case 0xF5: return DecodeType(byteArray, ref p); + case 0xF6: return DecodeType(byteArray, ref p); + case 0xF7: return DecodeType(byteArray, ref p); + case 0xF8: return DecodeType(byteArray, ref p); + case 0xF9: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + where T245 : IType, new() + where T246 : IType, new() + where T247 : IType, new() + where T248 : IType, new() + where T249 : IType, new() + where T250 : IType, new() + where T251 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + case 0xF4: return DecodeType(byteArray, ref p); + case 0xF5: return DecodeType(byteArray, ref p); + case 0xF6: return DecodeType(byteArray, ref p); + case 0xF7: return DecodeType(byteArray, ref p); + case 0xF8: return DecodeType(byteArray, ref p); + case 0xF9: return DecodeType(byteArray, ref p); + case 0xFA: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + where T245 : IType, new() + where T246 : IType, new() + where T247 : IType, new() + where T248 : IType, new() + where T249 : IType, new() + where T250 : IType, new() + where T251 : IType, new() + where T252 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + case 0xF4: return DecodeType(byteArray, ref p); + case 0xF5: return DecodeType(byteArray, ref p); + case 0xF6: return DecodeType(byteArray, ref p); + case 0xF7: return DecodeType(byteArray, ref p); + case 0xF8: return DecodeType(byteArray, ref p); + case 0xF9: return DecodeType(byteArray, ref p); + case 0xFA: return DecodeType(byteArray, ref p); + case 0xFB: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + where T245 : IType, new() + where T246 : IType, new() + where T247 : IType, new() + where T248 : IType, new() + where T249 : IType, new() + where T250 : IType, new() + where T251 : IType, new() + where T252 : IType, new() + where T253 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + case 0xF4: return DecodeType(byteArray, ref p); + case 0xF5: return DecodeType(byteArray, ref p); + case 0xF6: return DecodeType(byteArray, ref p); + case 0xF7: return DecodeType(byteArray, ref p); + case 0xF8: return DecodeType(byteArray, ref p); + case 0xF9: return DecodeType(byteArray, ref p); + case 0xFA: return DecodeType(byteArray, ref p); + case 0xFB: return DecodeType(byteArray, ref p); + case 0xFC: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + where T245 : IType, new() + where T246 : IType, new() + where T247 : IType, new() + where T248 : IType, new() + where T249 : IType, new() + where T250 : IType, new() + where T251 : IType, new() + where T252 : IType, new() + where T253 : IType, new() + where T254 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + case 0xF4: return DecodeType(byteArray, ref p); + case 0xF5: return DecodeType(byteArray, ref p); + case 0xF6: return DecodeType(byteArray, ref p); + case 0xF7: return DecodeType(byteArray, ref p); + case 0xF8: return DecodeType(byteArray, ref p); + case 0xF9: return DecodeType(byteArray, ref p); + case 0xFA: return DecodeType(byteArray, ref p); + case 0xFB: return DecodeType(byteArray, ref p); + case 0xFC: return DecodeType(byteArray, ref p); + case 0xFD: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + /// + public class BaseEnumExt : BaseEnumType + where T0 : Enum + where T1 : IType, new() + where T2 : IType, new() + where T3 : IType, new() + where T4 : IType, new() + where T5 : IType, new() + where T6 : IType, new() + where T7 : IType, new() + where T8 : IType, new() + where T9 : IType, new() + where T10 : IType, new() + where T11 : IType, new() + where T12 : IType, new() + where T13 : IType, new() + where T14 : IType, new() + where T15 : IType, new() + where T16 : IType, new() + where T17 : IType, new() + where T18 : IType, new() + where T19 : IType, new() + where T20 : IType, new() + where T21 : IType, new() + where T22 : IType, new() + where T23 : IType, new() + where T24 : IType, new() + where T25 : IType, new() + where T26 : IType, new() + where T27 : IType, new() + where T28 : IType, new() + where T29 : IType, new() + where T30 : IType, new() + where T31 : IType, new() + where T32 : IType, new() + where T33 : IType, new() + where T34 : IType, new() + where T35 : IType, new() + where T36 : IType, new() + where T37 : IType, new() + where T38 : IType, new() + where T39 : IType, new() + where T40 : IType, new() + where T41 : IType, new() + where T42 : IType, new() + where T43 : IType, new() + where T44 : IType, new() + where T45 : IType, new() + where T46 : IType, new() + where T47 : IType, new() + where T48 : IType, new() + where T49 : IType, new() + where T50 : IType, new() + where T51 : IType, new() + where T52 : IType, new() + where T53 : IType, new() + where T54 : IType, new() + where T55 : IType, new() + where T56 : IType, new() + where T57 : IType, new() + where T58 : IType, new() + where T59 : IType, new() + where T60 : IType, new() + where T61 : IType, new() + where T62 : IType, new() + where T63 : IType, new() + where T64 : IType, new() + where T65 : IType, new() + where T66 : IType, new() + where T67 : IType, new() + where T68 : IType, new() + where T69 : IType, new() + where T70 : IType, new() + where T71 : IType, new() + where T72 : IType, new() + where T73 : IType, new() + where T74 : IType, new() + where T75 : IType, new() + where T76 : IType, new() + where T77 : IType, new() + where T78 : IType, new() + where T79 : IType, new() + where T80 : IType, new() + where T81 : IType, new() + where T82 : IType, new() + where T83 : IType, new() + where T84 : IType, new() + where T85 : IType, new() + where T86 : IType, new() + where T87 : IType, new() + where T88 : IType, new() + where T89 : IType, new() + where T90 : IType, new() + where T91 : IType, new() + where T92 : IType, new() + where T93 : IType, new() + where T94 : IType, new() + where T95 : IType, new() + where T96 : IType, new() + where T97 : IType, new() + where T98 : IType, new() + where T99 : IType, new() + where T100 : IType, new() + where T101 : IType, new() + where T102 : IType, new() + where T103 : IType, new() + where T104 : IType, new() + where T105 : IType, new() + where T106 : IType, new() + where T107 : IType, new() + where T108 : IType, new() + where T109 : IType, new() + where T110 : IType, new() + where T111 : IType, new() + where T112 : IType, new() + where T113 : IType, new() + where T114 : IType, new() + where T115 : IType, new() + where T116 : IType, new() + where T117 : IType, new() + where T118 : IType, new() + where T119 : IType, new() + where T120 : IType, new() + where T121 : IType, new() + where T122 : IType, new() + where T123 : IType, new() + where T124 : IType, new() + where T125 : IType, new() + where T126 : IType, new() + where T127 : IType, new() + where T128 : IType, new() + where T129 : IType, new() + where T130 : IType, new() + where T131 : IType, new() + where T132 : IType, new() + where T133 : IType, new() + where T134 : IType, new() + where T135 : IType, new() + where T136 : IType, new() + where T137 : IType, new() + where T138 : IType, new() + where T139 : IType, new() + where T140 : IType, new() + where T141 : IType, new() + where T142 : IType, new() + where T143 : IType, new() + where T144 : IType, new() + where T145 : IType, new() + where T146 : IType, new() + where T147 : IType, new() + where T148 : IType, new() + where T149 : IType, new() + where T150 : IType, new() + where T151 : IType, new() + where T152 : IType, new() + where T153 : IType, new() + where T154 : IType, new() + where T155 : IType, new() + where T156 : IType, new() + where T157 : IType, new() + where T158 : IType, new() + where T159 : IType, new() + where T160 : IType, new() + where T161 : IType, new() + where T162 : IType, new() + where T163 : IType, new() + where T164 : IType, new() + where T165 : IType, new() + where T166 : IType, new() + where T167 : IType, new() + where T168 : IType, new() + where T169 : IType, new() + where T170 : IType, new() + where T171 : IType, new() + where T172 : IType, new() + where T173 : IType, new() + where T174 : IType, new() + where T175 : IType, new() + where T176 : IType, new() + where T177 : IType, new() + where T178 : IType, new() + where T179 : IType, new() + where T180 : IType, new() + where T181 : IType, new() + where T182 : IType, new() + where T183 : IType, new() + where T184 : IType, new() + where T185 : IType, new() + where T186 : IType, new() + where T187 : IType, new() + where T188 : IType, new() + where T189 : IType, new() + where T190 : IType, new() + where T191 : IType, new() + where T192 : IType, new() + where T193 : IType, new() + where T194 : IType, new() + where T195 : IType, new() + where T196 : IType, new() + where T197 : IType, new() + where T198 : IType, new() + where T199 : IType, new() + where T200 : IType, new() + where T201 : IType, new() + where T202 : IType, new() + where T203 : IType, new() + where T204 : IType, new() + where T205 : IType, new() + where T206 : IType, new() + where T207 : IType, new() + where T208 : IType, new() + where T209 : IType, new() + where T210 : IType, new() + where T211 : IType, new() + where T212 : IType, new() + where T213 : IType, new() + where T214 : IType, new() + where T215 : IType, new() + where T216 : IType, new() + where T217 : IType, new() + where T218 : IType, new() + where T219 : IType, new() + where T220 : IType, new() + where T221 : IType, new() + where T222 : IType, new() + where T223 : IType, new() + where T224 : IType, new() + where T225 : IType, new() + where T226 : IType, new() + where T227 : IType, new() + where T228 : IType, new() + where T229 : IType, new() + where T230 : IType, new() + where T231 : IType, new() + where T232 : IType, new() + where T233 : IType, new() + where T234 : IType, new() + where T235 : IType, new() + where T236 : IType, new() + where T237 : IType, new() + where T238 : IType, new() + where T239 : IType, new() + where T240 : IType, new() + where T241 : IType, new() + where T242 : IType, new() + where T243 : IType, new() + where T244 : IType, new() + where T245 : IType, new() + where T246 : IType, new() + where T247 : IType, new() + where T248 : IType, new() + where T249 : IType, new() + where T250 : IType, new() + where T251 : IType, new() + where T252 : IType, new() + where T253 : IType, new() + where T254 : IType, new() + where T255 : IType, new() + { + /// + public override string TypeName() => typeof(T0).Name; + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + + Value = (T0)Enum.Parse(typeof(T0), enumByte.ToString(), true); + p += 1; + + Value2 = DecodeOneOf(enumByte, byteArray, ref p); + + TypeSize = p - start; + + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + /// BaseEnumExt DecodeOneOf + /// + private IType DecodeOneOf(byte value, byte[] byteArray, ref int p) + { + switch (value) + { + case 0x00: return DecodeType(byteArray, ref p); + case 0x01: return DecodeType(byteArray, ref p); + case 0x02: return DecodeType(byteArray, ref p); + case 0x03: return DecodeType(byteArray, ref p); + case 0x04: return DecodeType(byteArray, ref p); + case 0x05: return DecodeType(byteArray, ref p); + case 0x06: return DecodeType(byteArray, ref p); + case 0x07: return DecodeType(byteArray, ref p); + case 0x08: return DecodeType(byteArray, ref p); + case 0x09: return DecodeType(byteArray, ref p); + case 0x0A: return DecodeType(byteArray, ref p); + case 0x0B: return DecodeType(byteArray, ref p); + case 0x0C: return DecodeType(byteArray, ref p); + case 0x0D: return DecodeType(byteArray, ref p); + case 0x0E: return DecodeType(byteArray, ref p); + case 0x0F: return DecodeType(byteArray, ref p); + case 0x10: return DecodeType(byteArray, ref p); + case 0x11: return DecodeType(byteArray, ref p); + case 0x12: return DecodeType(byteArray, ref p); + case 0x13: return DecodeType(byteArray, ref p); + case 0x14: return DecodeType(byteArray, ref p); + case 0x15: return DecodeType(byteArray, ref p); + case 0x16: return DecodeType(byteArray, ref p); + case 0x17: return DecodeType(byteArray, ref p); + case 0x18: return DecodeType(byteArray, ref p); + case 0x19: return DecodeType(byteArray, ref p); + case 0x1A: return DecodeType(byteArray, ref p); + case 0x1B: return DecodeType(byteArray, ref p); + case 0x1C: return DecodeType(byteArray, ref p); + case 0x1D: return DecodeType(byteArray, ref p); + case 0x1E: return DecodeType(byteArray, ref p); + case 0x1F: return DecodeType(byteArray, ref p); + case 0x20: return DecodeType(byteArray, ref p); + case 0x21: return DecodeType(byteArray, ref p); + case 0x22: return DecodeType(byteArray, ref p); + case 0x23: return DecodeType(byteArray, ref p); + case 0x24: return DecodeType(byteArray, ref p); + case 0x25: return DecodeType(byteArray, ref p); + case 0x26: return DecodeType(byteArray, ref p); + case 0x27: return DecodeType(byteArray, ref p); + case 0x28: return DecodeType(byteArray, ref p); + case 0x29: return DecodeType(byteArray, ref p); + case 0x2A: return DecodeType(byteArray, ref p); + case 0x2B: return DecodeType(byteArray, ref p); + case 0x2C: return DecodeType(byteArray, ref p); + case 0x2D: return DecodeType(byteArray, ref p); + case 0x2E: return DecodeType(byteArray, ref p); + case 0x2F: return DecodeType(byteArray, ref p); + case 0x30: return DecodeType(byteArray, ref p); + case 0x31: return DecodeType(byteArray, ref p); + case 0x32: return DecodeType(byteArray, ref p); + case 0x33: return DecodeType(byteArray, ref p); + case 0x34: return DecodeType(byteArray, ref p); + case 0x35: return DecodeType(byteArray, ref p); + case 0x36: return DecodeType(byteArray, ref p); + case 0x37: return DecodeType(byteArray, ref p); + case 0x38: return DecodeType(byteArray, ref p); + case 0x39: return DecodeType(byteArray, ref p); + case 0x3A: return DecodeType(byteArray, ref p); + case 0x3B: return DecodeType(byteArray, ref p); + case 0x3C: return DecodeType(byteArray, ref p); + case 0x3D: return DecodeType(byteArray, ref p); + case 0x3E: return DecodeType(byteArray, ref p); + case 0x3F: return DecodeType(byteArray, ref p); + case 0x40: return DecodeType(byteArray, ref p); + case 0x41: return DecodeType(byteArray, ref p); + case 0x42: return DecodeType(byteArray, ref p); + case 0x43: return DecodeType(byteArray, ref p); + case 0x44: return DecodeType(byteArray, ref p); + case 0x45: return DecodeType(byteArray, ref p); + case 0x46: return DecodeType(byteArray, ref p); + case 0x47: return DecodeType(byteArray, ref p); + case 0x48: return DecodeType(byteArray, ref p); + case 0x49: return DecodeType(byteArray, ref p); + case 0x4A: return DecodeType(byteArray, ref p); + case 0x4B: return DecodeType(byteArray, ref p); + case 0x4C: return DecodeType(byteArray, ref p); + case 0x4D: return DecodeType(byteArray, ref p); + case 0x4E: return DecodeType(byteArray, ref p); + case 0x4F: return DecodeType(byteArray, ref p); + case 0x50: return DecodeType(byteArray, ref p); + case 0x51: return DecodeType(byteArray, ref p); + case 0x52: return DecodeType(byteArray, ref p); + case 0x53: return DecodeType(byteArray, ref p); + case 0x54: return DecodeType(byteArray, ref p); + case 0x55: return DecodeType(byteArray, ref p); + case 0x56: return DecodeType(byteArray, ref p); + case 0x57: return DecodeType(byteArray, ref p); + case 0x58: return DecodeType(byteArray, ref p); + case 0x59: return DecodeType(byteArray, ref p); + case 0x5A: return DecodeType(byteArray, ref p); + case 0x5B: return DecodeType(byteArray, ref p); + case 0x5C: return DecodeType(byteArray, ref p); + case 0x5D: return DecodeType(byteArray, ref p); + case 0x5E: return DecodeType(byteArray, ref p); + case 0x5F: return DecodeType(byteArray, ref p); + case 0x60: return DecodeType(byteArray, ref p); + case 0x61: return DecodeType(byteArray, ref p); + case 0x62: return DecodeType(byteArray, ref p); + case 0x63: return DecodeType(byteArray, ref p); + case 0x64: return DecodeType(byteArray, ref p); + case 0x65: return DecodeType(byteArray, ref p); + case 0x66: return DecodeType(byteArray, ref p); + case 0x67: return DecodeType(byteArray, ref p); + case 0x68: return DecodeType(byteArray, ref p); + case 0x69: return DecodeType(byteArray, ref p); + case 0x6A: return DecodeType(byteArray, ref p); + case 0x6B: return DecodeType(byteArray, ref p); + case 0x6C: return DecodeType(byteArray, ref p); + case 0x6D: return DecodeType(byteArray, ref p); + case 0x6E: return DecodeType(byteArray, ref p); + case 0x6F: return DecodeType(byteArray, ref p); + case 0x70: return DecodeType(byteArray, ref p); + case 0x71: return DecodeType(byteArray, ref p); + case 0x72: return DecodeType(byteArray, ref p); + case 0x73: return DecodeType(byteArray, ref p); + case 0x74: return DecodeType(byteArray, ref p); + case 0x75: return DecodeType(byteArray, ref p); + case 0x76: return DecodeType(byteArray, ref p); + case 0x77: return DecodeType(byteArray, ref p); + case 0x78: return DecodeType(byteArray, ref p); + case 0x79: return DecodeType(byteArray, ref p); + case 0x7A: return DecodeType(byteArray, ref p); + case 0x7B: return DecodeType(byteArray, ref p); + case 0x7C: return DecodeType(byteArray, ref p); + case 0x7D: return DecodeType(byteArray, ref p); + case 0x7E: return DecodeType(byteArray, ref p); + case 0x7F: return DecodeType(byteArray, ref p); + case 0x80: return DecodeType(byteArray, ref p); + case 0x81: return DecodeType(byteArray, ref p); + case 0x82: return DecodeType(byteArray, ref p); + case 0x83: return DecodeType(byteArray, ref p); + case 0x84: return DecodeType(byteArray, ref p); + case 0x85: return DecodeType(byteArray, ref p); + case 0x86: return DecodeType(byteArray, ref p); + case 0x87: return DecodeType(byteArray, ref p); + case 0x88: return DecodeType(byteArray, ref p); + case 0x89: return DecodeType(byteArray, ref p); + case 0x8A: return DecodeType(byteArray, ref p); + case 0x8B: return DecodeType(byteArray, ref p); + case 0x8C: return DecodeType(byteArray, ref p); + case 0x8D: return DecodeType(byteArray, ref p); + case 0x8E: return DecodeType(byteArray, ref p); + case 0x8F: return DecodeType(byteArray, ref p); + case 0x90: return DecodeType(byteArray, ref p); + case 0x91: return DecodeType(byteArray, ref p); + case 0x92: return DecodeType(byteArray, ref p); + case 0x93: return DecodeType(byteArray, ref p); + case 0x94: return DecodeType(byteArray, ref p); + case 0x95: return DecodeType(byteArray, ref p); + case 0x96: return DecodeType(byteArray, ref p); + case 0x97: return DecodeType(byteArray, ref p); + case 0x98: return DecodeType(byteArray, ref p); + case 0x99: return DecodeType(byteArray, ref p); + case 0x9A: return DecodeType(byteArray, ref p); + case 0x9B: return DecodeType(byteArray, ref p); + case 0x9C: return DecodeType(byteArray, ref p); + case 0x9D: return DecodeType(byteArray, ref p); + case 0x9E: return DecodeType(byteArray, ref p); + case 0x9F: return DecodeType(byteArray, ref p); + case 0xA0: return DecodeType(byteArray, ref p); + case 0xA1: return DecodeType(byteArray, ref p); + case 0xA2: return DecodeType(byteArray, ref p); + case 0xA3: return DecodeType(byteArray, ref p); + case 0xA4: return DecodeType(byteArray, ref p); + case 0xA5: return DecodeType(byteArray, ref p); + case 0xA6: return DecodeType(byteArray, ref p); + case 0xA7: return DecodeType(byteArray, ref p); + case 0xA8: return DecodeType(byteArray, ref p); + case 0xA9: return DecodeType(byteArray, ref p); + case 0xAA: return DecodeType(byteArray, ref p); + case 0xAB: return DecodeType(byteArray, ref p); + case 0xAC: return DecodeType(byteArray, ref p); + case 0xAD: return DecodeType(byteArray, ref p); + case 0xAE: return DecodeType(byteArray, ref p); + case 0xAF: return DecodeType(byteArray, ref p); + case 0xB0: return DecodeType(byteArray, ref p); + case 0xB1: return DecodeType(byteArray, ref p); + case 0xB2: return DecodeType(byteArray, ref p); + case 0xB3: return DecodeType(byteArray, ref p); + case 0xB4: return DecodeType(byteArray, ref p); + case 0xB5: return DecodeType(byteArray, ref p); + case 0xB6: return DecodeType(byteArray, ref p); + case 0xB7: return DecodeType(byteArray, ref p); + case 0xB8: return DecodeType(byteArray, ref p); + case 0xB9: return DecodeType(byteArray, ref p); + case 0xBA: return DecodeType(byteArray, ref p); + case 0xBB: return DecodeType(byteArray, ref p); + case 0xBC: return DecodeType(byteArray, ref p); + case 0xBD: return DecodeType(byteArray, ref p); + case 0xBE: return DecodeType(byteArray, ref p); + case 0xBF: return DecodeType(byteArray, ref p); + case 0xC0: return DecodeType(byteArray, ref p); + case 0xC1: return DecodeType(byteArray, ref p); + case 0xC2: return DecodeType(byteArray, ref p); + case 0xC3: return DecodeType(byteArray, ref p); + case 0xC4: return DecodeType(byteArray, ref p); + case 0xC5: return DecodeType(byteArray, ref p); + case 0xC6: return DecodeType(byteArray, ref p); + case 0xC7: return DecodeType(byteArray, ref p); + case 0xC8: return DecodeType(byteArray, ref p); + case 0xC9: return DecodeType(byteArray, ref p); + case 0xCA: return DecodeType(byteArray, ref p); + case 0xCB: return DecodeType(byteArray, ref p); + case 0xCC: return DecodeType(byteArray, ref p); + case 0xCD: return DecodeType(byteArray, ref p); + case 0xCE: return DecodeType(byteArray, ref p); + case 0xCF: return DecodeType(byteArray, ref p); + case 0xD0: return DecodeType(byteArray, ref p); + case 0xD1: return DecodeType(byteArray, ref p); + case 0xD2: return DecodeType(byteArray, ref p); + case 0xD3: return DecodeType(byteArray, ref p); + case 0xD4: return DecodeType(byteArray, ref p); + case 0xD5: return DecodeType(byteArray, ref p); + case 0xD6: return DecodeType(byteArray, ref p); + case 0xD7: return DecodeType(byteArray, ref p); + case 0xD8: return DecodeType(byteArray, ref p); + case 0xD9: return DecodeType(byteArray, ref p); + case 0xDA: return DecodeType(byteArray, ref p); + case 0xDB: return DecodeType(byteArray, ref p); + case 0xDC: return DecodeType(byteArray, ref p); + case 0xDD: return DecodeType(byteArray, ref p); + case 0xDE: return DecodeType(byteArray, ref p); + case 0xDF: return DecodeType(byteArray, ref p); + case 0xE0: return DecodeType(byteArray, ref p); + case 0xE1: return DecodeType(byteArray, ref p); + case 0xE2: return DecodeType(byteArray, ref p); + case 0xE3: return DecodeType(byteArray, ref p); + case 0xE4: return DecodeType(byteArray, ref p); + case 0xE5: return DecodeType(byteArray, ref p); + case 0xE6: return DecodeType(byteArray, ref p); + case 0xE7: return DecodeType(byteArray, ref p); + case 0xE8: return DecodeType(byteArray, ref p); + case 0xE9: return DecodeType(byteArray, ref p); + case 0xEA: return DecodeType(byteArray, ref p); + case 0xEB: return DecodeType(byteArray, ref p); + case 0xEC: return DecodeType(byteArray, ref p); + case 0xED: return DecodeType(byteArray, ref p); + case 0xEE: return DecodeType(byteArray, ref p); + case 0xEF: return DecodeType(byteArray, ref p); + case 0xF0: return DecodeType(byteArray, ref p); + case 0xF1: return DecodeType(byteArray, ref p); + case 0xF2: return DecodeType(byteArray, ref p); + case 0xF3: return DecodeType(byteArray, ref p); + case 0xF4: return DecodeType(byteArray, ref p); + case 0xF5: return DecodeType(byteArray, ref p); + case 0xF6: return DecodeType(byteArray, ref p); + case 0xF7: return DecodeType(byteArray, ref p); + case 0xF8: return DecodeType(byteArray, ref p); + case 0xF9: return DecodeType(byteArray, ref p); + case 0xFA: return DecodeType(byteArray, ref p); + case 0xFB: return DecodeType(byteArray, ref p); + case 0xFC: return DecodeType(byteArray, ref p); + case 0xFD: return DecodeType(byteArray, ref p); + case 0xFE: return DecodeType(byteArray, ref p); + default: + return null; + } + } + + /// + /// BaseEnumExt Create + /// + public void Create(T0 t, IType value2) + { + List bytes = new List(); + bytes.Add(Convert.ToByte(t)); + bytes.AddRange(value2.Encode()); + Bytes = bytes.ToArray(); + Value = t; + Value2 = value2; + TypeSize = Bytes.Length; + } + + /// + public override string ToString() => JsonConvert.SerializeObject(Value); + + /// + /// BaseEnumExt Enumeration Value + /// + [JsonConverter(typeof(StringEnumConverter))] + public T0 Value { get; set; } + + /// + /// BaseEnumExt Type Value + /// + public IType Value2 { get; set; } + } + + */ + /// public class BaseEnumExt : BaseEnumType where T0 : Enum diff --git a/Substrate.NetApi/Substrate.NetApi.csproj b/Substrate.NetApi/Substrate.NetApi.csproj index a53069a..08f7c2a 100644 --- a/Substrate.NetApi/Substrate.NetApi.csproj +++ b/Substrate.NetApi/Substrate.NetApi.csproj @@ -3,7 +3,7 @@ Substrate.NET.API netstandard2.0;netstandard2.1;net6.0 - 0.9.23-rc1 + 0.9.23 Substrate Gaming Substrate Gaming true