diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index a6319a1..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "SubstrateNetApiGen"] - path = SubstrateNetApiGen - url = https://github.com/JetonNetwork/SubstrateNetApiGen.git diff --git a/Substrate.NetApi.Test/Extrinsic/InstanceTest.cs b/Substrate.NetApi.Test/Extrinsic/InstanceTest.cs index 6b206f9..8294fcf 100644 --- a/Substrate.NetApi.Test/Extrinsic/InstanceTest.cs +++ b/Substrate.NetApi.Test/Extrinsic/InstanceTest.cs @@ -11,14 +11,15 @@ namespace Substrate.NetApi.Test.Extrinsic public class InstanceTest { + // Extrinsics created and signed with polkadot-js/apps. public static string[] Extrinsic = new string[] { // Timestamp set(now) with now = 1673908758014 - "0x280403000bfea5bcbc8501", + "0xc50184001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c0188f4859d09355d8f964b8cbb8b84c5e0e2f86a423d30027d15764996dc198532044424e6cc2e281f4d23174b6bfb3d2af64917b7356e570f41a1e44bcaa47385650300000001000bfea5bcbc8501", // Staking bondExtra(maxAdditional) with maxAditional = 60000000000 - "0xbd01840021e64ca11afde772615b240dd09ada3fc96e46619b77f9c0ce3dcebc67878939006ac2017f7951358d09ca1c6da63501b8d00dd72703e593b4a0ca924d59360d4968abaf6361999a21943618ce0850f8b5f8dd51c54c772ffccb35ff63208a1d0025012000070107005847f80d", + "0x710284001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c01d0e951a27297d1418d17fcbadfc19441d2d276f358965a94ff87f1b1db287c4cae203b65dab926627c80deae720bca1335d771389843b1bf69b9e85139922b819503000000070000001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c0a000000000000000000000000000000", // Balances transferKeepAlive(dest, value) - "0x45028400f371affe2fd3ebd6f0a607e983bc8f905cea0ca2668667a229e112b30c5f9bbd0096f3ac43319d2e980db0aaf2b7e5e985055ea87f7b2a91a2ee09a934aef55bad4ec0dfd93e7010bc5dbf290403051ec40d475534df90ce3e1dd8a5b1ab3f7a0e4502cd0e000503001c3ef60163945e2b4602f7c6b27fc1f8e79d7c3430e3518cf63dc8a6ee84e9740700325f9d08" + "0x4d0284001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c01e6da8673127ec665dbfb76322ffe12721caa9b747abc5b6ec8ab73ff34f07831ed9edc49d185483a0c538a120149b7b6367bcde7088873408cc49ec280976c8ba5000000000403001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c0f0080c6a47e8d03" }; [Test] diff --git a/Substrate.NetApi.Test/Extrinsic/PayloadTest.cs b/Substrate.NetApi.Test/Extrinsic/PayloadTest.cs index 7c86299..a9a961b 100644 --- a/Substrate.NetApi.Test/Extrinsic/PayloadTest.cs +++ b/Substrate.NetApi.Test/Extrinsic/PayloadTest.cs @@ -3,6 +3,7 @@ using Substrate.NetApi.Model.Extrinsics; using Substrate.NetApi.Model.Types.Base; using NUnit.Framework; +using Substrate.NetApi.Model.Types.Primitive; namespace Substrate.NetApi.Test.Extrinsic { @@ -52,14 +53,14 @@ public void EncodeExtraTest() var startEra = new Hash(); startEra.Create(blockHash); - var assetTxPayment = new ChargeAssetTxPayment(0, 0); + var assetTxPayment = new ChargeAssetTxPayment(0, new BaseOpt()); var signedExtensions = new SignedExtensions(259, 1, genesis, startEra, era, 0, assetTxPayment); var payload = new Payload(method, signedExtensions); var payloadBytes = Utils.StringValueArrayBytesArray( - "6, 0, 255, 212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125, 145, 1, 58, 6, 0, 0, 0, 3, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0"); + "6, 0, 255, 212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125, 145, 1, 58, 6, 0, 0, 0, 0, 3, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0"); Assert.AreEqual(payloadBytes, payload.Encode()); } diff --git a/Substrate.NetApi.Test/Extrinsic/SignedExtensionsTest.cs b/Substrate.NetApi.Test/Extrinsic/SignedExtensionsTest.cs index 0ddf35c..9ed4e62 100644 --- a/Substrate.NetApi.Test/Extrinsic/SignedExtensionsTest.cs +++ b/Substrate.NetApi.Test/Extrinsic/SignedExtensionsTest.cs @@ -2,6 +2,7 @@ using Substrate.NetApi.Model.Extrinsics; using Substrate.NetApi.Model.Types.Base; using NUnit.Framework; +using Substrate.NetApi.Model.Types.Primitive; namespace Substrate.NetApi.Test.Extrinsic { @@ -36,15 +37,15 @@ public void EncodeExtraTest() var startEra = new Hash(); startEra.Create(blockHash); - var assetTxPayment = new ChargeAssetTxPayment(0, 0); + var assetTxPayment = new ChargeAssetTxPayment(0, new BaseOpt()); var signedExtensions = new SignedExtensions(259, 1, genesis, startEra, era, 0, assetTxPayment); var bytes = Utils.StringValueArrayBytesArray( - "58, 6, 0, 0, 0, 3, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0"); + "58, 6, 0, 0, 0, 0, 3, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0"); - Assert.AreEqual(bytes.AsMemory().Slice(0, 5).ToArray(), signedExtensions.GetExtra()); - Assert.AreEqual(bytes.AsMemory().Slice(5, 72).ToArray(), signedExtensions.GetAdditionalSigned()); + Assert.AreEqual(bytes.AsMemory().Slice(0, 6).ToArray(), signedExtensions.GetExtra()); + Assert.AreEqual(bytes.AsMemory().Slice(6, 73).ToArray(), signedExtensions.GetAdditionalSigned()); Assert.AreEqual(bytes, signedExtensions.Encode()); } } diff --git a/Substrate.NetApi.Test/TypeConverters/EnumRustTest.cs b/Substrate.NetApi.Test/TypeConverters/EnumRustTest.cs new file mode 100644 index 0000000..3650e19 --- /dev/null +++ b/Substrate.NetApi.Test/TypeConverters/EnumRustTest.cs @@ -0,0 +1,94 @@ +using NUnit.Framework; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; +using System.Collections.Generic; + +namespace Substrate.NetApi.Tests +{ + public enum PhaseState + { + None = 0, + Finalization = 1, + Initialization = 2 + } + + [TestFixture] + public class BaseEnumRustTests + { + [Test] + public void ExtEnumEncodingTest() + { + var typeDecoderMap = new Dictionary + { + { PhaseState.None, typeof(U8) }, + { PhaseState.Finalization, typeof(BaseVoid) }, + { PhaseState.Initialization, typeof(BaseVoid) } + }; + + var extEnumType = new BaseEnumRust(typeDecoderMap); + + int p = 0; + extEnumType.Decode(new byte[] { 0x00, 0x01 }, ref p); + + Assert.AreEqual(PhaseState.None, extEnumType.Value); + Assert.AreEqual("U8", extEnumType.Value2.GetType().Name); + Assert.AreEqual(1, (extEnumType.Value2 as U8).Value); + } + + [Test] + public void ExtEnumDencodingTest() + { + var typeDecoderMap = new Dictionary + { + { PhaseState.None, typeof(U8) }, + { PhaseState.Finalization, typeof(BaseVoid) }, + { PhaseState.Initialization, typeof(BaseVoid) } + }; + + var extEnumType = new BaseEnumRust(typeDecoderMap); + + int p = 0; + extEnumType.Decode(new byte[] { 0x00, 0x01 }, ref p); + + Assert.AreEqual(PhaseState.None, extEnumType.Value); + Assert.AreEqual("U8", extEnumType.Value2.GetType().Name); + Assert.AreEqual(1, (extEnumType.Value2 as U8).Value); + + Assert.AreEqual(new byte[] { 0x00, 0x01 }, extEnumType.Bytes); + } + + [Test] + public void ExtEnumCreateTest() + { + var typeDecoderMap = new Dictionary + { + { PhaseState.None, typeof(U8) }, + { PhaseState.Finalization, typeof(BaseVoid) }, + { PhaseState.Initialization, typeof(BaseVoid) } + }; + + var u8 = new U8(1); + var byValue = new BaseEnumRust(typeDecoderMap); + byValue.Create(PhaseState.None, u8); + + var byArray = new BaseEnumRust(); + byArray.AddTypeDecoder(PhaseState.None); + byArray.AddTypeDecoder(PhaseState.Finalization); + byArray.AddTypeDecoder(PhaseState.Initialization); + byArray.Create(new byte[] { 0, 1 }); + + var byHex = new BaseEnumRust(); + byHex.AddTypeDecoder(PhaseState.None); + byHex.AddTypeDecoder(PhaseState.Finalization); + byHex.AddTypeDecoder(PhaseState.Initialization); + byHex.Create("0x0001"); + + Assert.That(byValue.Bytes, Is.EqualTo(byArray.Bytes)); + Assert.That(byValue.Value, Is.EqualTo(byArray.Value)); + + Assert.That(byValue.Bytes, Is.EqualTo(byHex.Bytes)); + Assert.That(byValue.Value, Is.EqualTo(byHex.Value)); + } + } +} \ No newline at end of file diff --git a/Substrate.NetApi.Test/TypeConverters/TupleRustTest.cs b/Substrate.NetApi.Test/TypeConverters/TupleRustTest.cs new file mode 100644 index 0000000..1178ab0 --- /dev/null +++ b/Substrate.NetApi.Test/TypeConverters/TupleRustTest.cs @@ -0,0 +1,97 @@ +using NUnit.Framework; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; +using System.Collections.Generic; + +namespace Substrate.NetApi.Tests +{ + [TestFixture] + public class BaseTupleTests + { + [Test] + public void BaseTupleTest() + { + var u16Param = new U16(42); + + var t1 = new BaseTupleRust(typeof(U16)); + t1.Create("0x2a00"); + + Assert.AreEqual(1, t1.Value.Length); + Assert.AreEqual(t1.Bytes, new BaseTupleRust(new U16(42)).Bytes); + Assert.AreEqual(((U16)t1.Value[0]).Value, ((U16)new BaseTupleRust(new U16(42)).Value[0]).Value); + Assert.AreEqual(t1.TypeSize, new BaseTupleRust(new U16(42)).TypeSize); + + var t2 = new BaseTupleRust(typeof(U16), typeof(U16)); + t2.Create("0x2a002a00"); + Assert.AreEqual(2, t2.Value.Length); + Assert.AreEqual(t2.Bytes, new BaseTupleRust(new U16(42), new U16(42)).Bytes); + Assert.AreEqual(((U16)t2.Value[0]).Value, ((U16)new BaseTupleRust(new U16(42), new U16(42)).Value[0]).Value); + Assert.AreEqual(((U16)t2.Value[1]).Value, ((U16)new BaseTupleRust(new U16(42), new U16(42)).Value[1]).Value); + Assert.AreEqual(t2.TypeSize, new BaseTupleRust(new U16(42), new U16(42)).TypeSize); + + var t3 = new BaseTupleRust(typeof(U16), typeof(U16), typeof(U16)); + t3.Create("0x2a002a002a00"); + Assert.AreEqual(3, t3.Value.Length); + Assert.AreEqual(t3.Bytes, new BaseTupleRust(new U16(42), new U16(42), new U16(42)).Bytes); + Assert.AreEqual(((U16)t3.Value[0]).Value, ((U16)new BaseTupleRust(new U16(42), new U16(42), new U16(42)).Value[0]).Value); + Assert.AreEqual(((U16)t3.Value[1]).Value, ((U16)new BaseTupleRust(new U16(42), new U16(42), new U16(42)).Value[1]).Value); + Assert.AreEqual(((U16)t3.Value[2]).Value, ((U16)new BaseTupleRust(new U16(42), new U16(42), new U16(42)).Value[2]).Value); + Assert.AreEqual(t3.TypeSize, new BaseTupleRust(new U16(42), new U16(42), new U16(42)).TypeSize); + } + + [Test] + public void BaseTupleCreateTest() + { + var u16 = new U16(); + u16.Create("0x2a00"); + + var u32 = new U32(); + u32.Create("0xffffff00"); + + var tupleOfTwo_1 = new BaseTupleRust(u16, u32); + Assert.AreEqual("0x2A00FFFFFF00", Utils.Bytes2HexString(tupleOfTwo_1.Encode())); + Assert.AreEqual(tupleOfTwo_1.Value.Length, new BaseTupleRust(u16, u32).Value.Length); + Assert.AreEqual(tupleOfTwo_1.Bytes, new BaseTupleRust(u16, u32).Bytes); + Assert.AreEqual(((U16)tupleOfTwo_1.Value[0]).Value, ((U16)new BaseTupleRust(u16, u32).Value[0]).Value); + Assert.AreEqual(((U32)tupleOfTwo_1.Value[1]).Value, ((U32)new BaseTupleRust(u16, u32).Value[1]).Value); + + var tupleOfTwo_2 = new BaseTupleRust(typeof(U16), typeof(U32)); + tupleOfTwo_2.Create("0x2A00FFFFFF00"); + + Assert.AreEqual(u16.Value, ((U16)tupleOfTwo_2.Value[0]).Value); + Assert.AreEqual(u32.Value, ((U32)tupleOfTwo_2.Value[1]).Value); + + Assert.AreEqual(tupleOfTwo_1.Value.Length, tupleOfTwo_2.Value.Length); + Assert.AreEqual(tupleOfTwo_1.Bytes, tupleOfTwo_2.Bytes); + Assert.AreEqual(((U16)tupleOfTwo_1.Value[0]).Value, ((U16)tupleOfTwo_2.Value[0]).Value); + Assert.AreEqual(((U32)tupleOfTwo_1.Value[1]).Value, ((U32)tupleOfTwo_2.Value[1]).Value); + } + + [Test] + public void BaseTypeEqualityWithNullBytes() + { + var baseTuple_1 = new BaseTupleRust(typeof(U32), typeof(U32)); + var baseTuple_2 = new BaseTupleRust(typeof(U32), typeof(U32)); + Assert.That(baseTuple_1.Bytes, Is.Null); + Assert.That(baseTuple_1.Value, Is.Null); + Assert.AreEqual(baseTuple_1.Bytes, baseTuple_2.Bytes); + Assert.AreEqual(baseTuple_1.Value, baseTuple_2.Value); + + var baseOpt_1 = new BaseOpt(); + var baseOpt_2 = new BaseOpt(); + Assert.That(baseOpt_1.Bytes, Is.Null); + Assert.That(baseOpt_1.Value, Is.Null); + Assert.AreEqual(baseOpt_1.Bytes, baseOpt_2.Bytes); + Assert.AreEqual(baseOpt_1.Value, baseOpt_2.Value); + + var baseVec_1 = new BaseVec(); + var baseVec_2 = new BaseVec(); + Assert.That(baseVec_1.Bytes, Is.Null); + Assert.That(baseVec_1.Value, Is.Null); + Assert.AreEqual(baseVec_1.Bytes, baseVec_2.Bytes); + Assert.AreEqual(baseVec_1.Value, baseVec_2.Value); + } + } + +} \ No newline at end of file diff --git a/Substrate.NetApi.Test/TypeConverters/TypeEncodingTest.cs b/Substrate.NetApi.Test/TypeConverters/TypeEncodingTest.cs index db7bd77..ab1aca7 100644 --- a/Substrate.NetApi.Test/TypeConverters/TypeEncodingTest.cs +++ b/Substrate.NetApi.Test/TypeConverters/TypeEncodingTest.cs @@ -112,7 +112,7 @@ public enum PhaseState [Test] public void ExtEnumEncodingTest() { - var extEnumType = new BaseEnumExt(); + var extEnumType = new BaseEnumExt(); int p = 0; extEnumType.Decode(new byte[] { 0x00, 0x01 }, ref p); @@ -125,7 +125,7 @@ public void ExtEnumEncodingTest() [Test] public void ExtEnumDencodingTest() { - var extEnumType = new BaseEnumExt(); + var extEnumType = new BaseEnumExt(); int p = 0; extEnumType.Decode(new byte[] { 0x00, 0x01 }, ref p); diff --git a/Substrate.NetApi.TestNode/BasicTest.cs b/Substrate.NetApi.TestNode/BasicTest.cs index e737be5..f705d03 100644 --- a/Substrate.NetApi.TestNode/BasicTest.cs +++ b/Substrate.NetApi.TestNode/BasicTest.cs @@ -40,7 +40,7 @@ public async Task GetSystemChainTestAsync() { var result = await _substrateClient.System.ChainAsync(CancellationToken.None); - Assert.AreEqual("Bajun Kusama", result); + Assert.AreEqual("Polkadot", result); } [Test] @@ -80,9 +80,9 @@ public async Task GetSystemPropertiesTestAsync() { var result = await _substrateClient.System.PropertiesAsync(CancellationToken.None); - Assert.AreEqual(1337, result.Ss58Format); - Assert.AreEqual(12, result.TokenDecimals); - Assert.AreEqual("BAJU", result.TokenSymbol); + Assert.AreEqual(0, result.Ss58Format); + Assert.AreEqual(10, result.TokenDecimals); + Assert.AreEqual("DOT", result.TokenSymbol); } [Test] @@ -93,7 +93,7 @@ public async Task GetBlockNumberTestAsync() var result = await _substrateClient.Chain.GetBlockHashAsync(blockNumber, CancellationToken.None); - Assert.AreEqual("0x35A06BFEC2EDF0FF4BE89A6428CCD9FF5BD0167D618C5A0D4341F9600A458D14", result.Value); + Assert.AreEqual("0x91B171BB158E2D3848FA23A9F1C25182FB8E20313B2C1EB49219DA7A70CE90C3", result.Value); } [Test] @@ -110,7 +110,7 @@ public async Task GetAccountInfoTestAsync() var result = await _substrateClient.GetStorageAsync(parameters, CancellationToken.None); Assert.IsNotNull(result); - Assert.AreEqual("0x35A06BFEC2EDF0FF4BE89A6428CCD9FF5BD0167D618C5A0D4341F9600A458D14", Utils.Bytes2HexString(result.Value.Select(p => p.Value).ToArray())); + Assert.AreEqual("0x91B171BB158E2D3848FA23A9F1C25182FB8E20313B2C1EB49219DA7A70CE90C3", Utils.Bytes2HexString(result.Value.Select(p => p.Value).ToArray())); blockNumber.Create(999999999); diff --git a/Substrate.NetApi.TestNode/ExtrinsicsTest.cs b/Substrate.NetApi.TestNode/ExtrinsicsTest.cs index 2530a34..9c6cd8b 100644 --- a/Substrate.NetApi.TestNode/ExtrinsicsTest.cs +++ b/Substrate.NetApi.TestNode/ExtrinsicsTest.cs @@ -1,5 +1,4 @@ using NUnit.Framework; -using NUnit.Framework.Internal; using Substrate.NET.Schnorrkel.Keys; using Substrate.NetApi.Model.Extrinsics; using Substrate.NetApi.Model.Rpc; @@ -7,6 +6,7 @@ using Substrate.NetApi.Model.Types.Base; using Substrate.NetApi.Model.Types.Primitive; using System; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; @@ -40,7 +40,7 @@ public async Task CloseAsync() [OneTimeSetUp] public async Task SetupAsync() { - _chargeType = ChargeTransactionPayment.Default(); + _chargeType = ChargeAssetTxPayment.Default(); _substrateClient = new SubstrateClient(new Uri(WebSocketUrl), _chargeType); try @@ -50,7 +50,7 @@ public async Task SetupAsync() catch (Exception ex) { Console.WriteLine($"Failed to connect to Substrate node: {ex.Message}"); - Assert.Ignore("Skipped test because no active Substrate node was found on 127.0.0.1:9944"); + Assert.Ignore("Skipped test because no active Substrate node was found on 127.0.0.1:9999"); } } @@ -65,7 +65,7 @@ public async Task TearDownAsync() } /// - /// Extrinsic Submit And Watch + /// Extrinsic Submit And Watch with non-native payment. /// /// [Test] @@ -73,11 +73,15 @@ public async Task Extrinsic_SubmitAndWatchExtrinsicAsync() { var iType = new BaseVec(new U8[] { (U8)0x04, (U8)0xFF }); + // Pay with a non-native asset with `assetId=0`, e.g. DOT on Ajuna Polkadot or PAS on Ajuna Paseo. + var assetCharge = ChargeAssetTxPayment.NewWithAsset(0, new U32(0)); var method = new Method(0, "System", 0, "remark", new IType[] { iType }); var taskCompletionSource = new TaskCompletionSource<(bool, Hash)>(); await _substrateClient.Author.SubmitAndWatchExtrinsicAsync((string subscriptionId, ExtrinsicStatus extrinsicUpdate) => { + Debug.WriteLine($"ExtrinsicUpdate: {extrinsicUpdate.ExtrinsicState}"); + switch (extrinsicUpdate.ExtrinsicState) { case ExtrinsicState.Finalized: @@ -92,7 +96,7 @@ await _substrateClient.Author.SubmitAndWatchExtrinsicAsync((string subscriptionI Assert.Fail("Extrinsic was invalid!"); break; } - }, method, Alice, _chargeType, 64, CancellationToken.None); + }, method, Alice, assetCharge, 64, CancellationToken.None); var finished = await Task.WhenAny(taskCompletionSource.Task, Task.Delay(TimeSpan.FromMinutes(1))); Assert.AreEqual(taskCompletionSource.Task, finished, "Test timed out waiting for final callback"); @@ -111,6 +115,8 @@ public async Task Extrinsic_TransactionV1SubmitAndWatchAsync() _ = await _substrateClient.TransactionWatchCalls.TransactionWatchV1SubmitAndWatchAsync( (subscriptionId, extrinsicUpdate) => { + Debug.WriteLine($"ExtrinsicUpdate: {extrinsicUpdate.TransactionEvent.ToString()}"); + switch (extrinsicUpdate.TransactionEvent) { case TransactionEvent.Finalized: diff --git a/Substrate.NetApi.TestNode/ModuleChainTest.cs b/Substrate.NetApi.TestNode/ModuleChainTest.cs new file mode 100644 index 0000000..7630fde --- /dev/null +++ b/Substrate.NetApi.TestNode/ModuleChainTest.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Metadata; +using System.Threading; +using System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using NUnit.Framework; +using StreamJsonRpc; +using Substrate.NetApi.Model.Rpc; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; + +namespace Substrate.NetApi.TestNode +{ + public class ModuleChainTest : NodeTest + { + [Test] + public async Task GetBlockAsyncTestAsync() + { + var result = await _substrateClient.Chain.GetBlockAsync(CancellationToken.None); + + Assert.IsNotNull(result); + } + + + } +} \ No newline at end of file diff --git a/Substrate.NetApi.TestNode/ModulePaymentTest.cs b/Substrate.NetApi.TestNode/ModulePaymentTest.cs index 85d97a9..371939d 100644 --- a/Substrate.NetApi.TestNode/ModulePaymentTest.cs +++ b/Substrate.NetApi.TestNode/ModulePaymentTest.cs @@ -11,7 +11,7 @@ namespace Substrate.NetApi.TestNode public class ModulePaymentTest : NodeTest { [Test] - [TestCase("0x5d02840094546ff56643b8c0fed386347d7a8cd0b995383125a0fc0f0e45f0e33a6c58270128da3e1cd19a10e3bbdd37ef0f24a0424a6febc1a6adeaa46ef0294a0f300e795dc4cfd380345b4fa53e28a8c258bd4ff4b0ed6554b78fc292d3aed0659ac48a45031989000f0700c87277c3912dfe4107ab28c32309c6b10ca6c0ad6ebc540fbfd26674db51b5291f0000005b2c765c5c43be65")] + [TestCase("0x4902840094546ff56643b8c0fed386347d7a8cd0b995383125a0fc0f0e45f0e33a6c582701b475d9d1d45cc3f372607f3542ba5671a9328303610e4b6274e7e574eeff3064a7d1a2bfb807d7a0577f9fc2b47925db22ffb9ec8c1bf04793c5a3a789edf28245020101000005030094546ff56643b8c0fed386347d7a8cd0b995383125a0fc0f0e45f0e33a6c58270700e40b5402")] public async Task QueryFeeDetailTestAsync(string extrinsicHex) { await _substrateClient.ConnectAsync(false, CancellationToken.None); @@ -23,7 +23,7 @@ public async Task QueryFeeDetailTestAsync(string extrinsicHex) } [Test] - [TestCase("0x5d02840094546ff56643b8c0fed386347d7a8cd0b995383125a0fc0f0e45f0e33a6c58270128da3e1cd19a10e3bbdd37ef0f24a0424a6febc1a6adeaa46ef0294a0f300e795dc4cfd380345b4fa53e28a8c258bd4ff4b0ed6554b78fc292d3aed0659ac48a45031989000f0700c87277c3912dfe4107ab28c32309c6b10ca6c0ad6ebc540fbfd26674db51b5291f0000005b2c765c5c43be65")] + [TestCase("0x4902840094546ff56643b8c0fed386347d7a8cd0b995383125a0fc0f0e45f0e33a6c582701b475d9d1d45cc3f372607f3542ba5671a9328303610e4b6274e7e574eeff3064a7d1a2bfb807d7a0577f9fc2b47925db22ffb9ec8c1bf04793c5a3a789edf28245020101000005030094546ff56643b8c0fed386347d7a8cd0b995383125a0fc0f0e45f0e33a6c58270700e40b5402")] public async Task QueryInfoTestAsync(string extrinsicHex) { diff --git a/Substrate.NetApi.TestNode/ModuleRuntimeCallTest.cs b/Substrate.NetApi.TestNode/ModuleRuntimeCallTest.cs new file mode 100644 index 0000000..c31cadd --- /dev/null +++ b/Substrate.NetApi.TestNode/ModuleRuntimeCallTest.cs @@ -0,0 +1,47 @@ +using NUnit.Framework; +using Substrate.NetApi.Model.Types.Metadata; +using Substrate.NetApi.Model.Types.Metadata.V14; +using System.Threading; +using System.Threading.Tasks; +using System.Linq; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; + +namespace Substrate.NetApi.TestNode +{ + public class ModuleRuntimeCallTest : NodeTest + { + [Test] + public async Task GetMetadataTestAsync() + { + var result14 = await _substrateClient.RuntimeCall.MetadataAsync(CancellationToken.None); + var mdv14 = new RuntimeMetadata(); + mdv14.Create(result14.Value.Select(p => p.Value).ToArray()); + Assert.IsNotNull(mdv14); + } + + [Test] + public async Task GetMetadataAtVersionTestAsync() + { + var result14 = await _substrateClient.RuntimeCall.MetadataAtVersionAsync(14, CancellationToken.None); + var mdv14 = new RuntimeMetadata(); + mdv14.Create(result14.Value.Value.Select(p => p.Value).ToArray()); + Assert.IsNotNull(mdv14); + + var result15 = await _substrateClient.RuntimeCall.MetadataAtVersionAsync(15, CancellationToken.None); + var mdv15 = new RuntimeMetadata(); + mdv15.Create(result15.Value.Value.Select(p => p.Value).ToArray()); + Assert.IsNotNull(mdv15); + } + + [Test] + public async Task GetMetadataVersionsTestAsync() + { + var result = await _substrateClient.RuntimeCall.MetadataVersionsAsync(CancellationToken.None); + + Assert.IsNotNull(result); + Assert.AreEqual(14, result.Value[0].Value); + Assert.AreEqual(15, result.Value[1].Value); + } + } +} \ No newline at end of file diff --git a/Substrate.NetApi.TestNode/ModuleStateTest.cs b/Substrate.NetApi.TestNode/ModuleStateTest.cs index d9ebb43..77d20f9 100644 --- a/Substrate.NetApi.TestNode/ModuleStateTest.cs +++ b/Substrate.NetApi.TestNode/ModuleStateTest.cs @@ -34,12 +34,12 @@ public async Task GetKeysPagedAtTestAsync() } [Test] - [TestCase("0x26aa394eea5630e07c48ae0c9558cef7a44704b568d21667356a5a050c118746b4def25cfda6ef3a00000000")] - public async Task GetQueryStorageAtAsyncTestAsync(string storageKeyHex) + [TestCase("0x26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac", "0xa6aeb4a363120918b0a844e2bb17113d7d96f512c025dacd0fa015b9125669cf")] + public async Task GetQueryStorageAtAsyncTestAsync(string storageKeyHex, string blockHash) { var storageKeys = new List() { Utils.HexToByteArray(storageKeyHex) }; - var results = await _substrateClient.State.GetQueryStorageAtAsync(storageKeys, string.Empty, CancellationToken.None); + var results = await _substrateClient.State.GetQueryStorageAtAsync(storageKeys, blockHash, CancellationToken.None); Assert.IsNotNull(results); Assert.IsNotNull(results.First()); @@ -47,8 +47,8 @@ public async Task GetQueryStorageAtAsyncTestAsync(string storageKeyHex) var result = results.First(); Assert.True(result.Block.Value.StartsWith("0x")); Assert.AreEqual(1, result.Changes.Length); - Assert.AreEqual("0x26aa394eea5630e07c48ae0c9558cef7a44704b568d21667356a5a050c118746b4def25cfda6ef3a00000000", result.Changes[0][0]); - Assert.AreEqual("0x35a06bfec2edf0ff4be89a6428ccd9ff5bd0167d618c5a0d4341f9600a458d14", result.Changes[0][1]); + Assert.AreEqual("0x26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac", result.Changes[0][0]); + Assert.AreEqual("0xc50c4e01", result.Changes[0][1]); } [Test] diff --git a/Substrate.NetApi.TestNode/NodeTest.cs b/Substrate.NetApi.TestNode/NodeTest.cs index 7653da6..3f1ecaa 100644 --- a/Substrate.NetApi.TestNode/NodeTest.cs +++ b/Substrate.NetApi.TestNode/NodeTest.cs @@ -5,12 +5,15 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Substrate.NetApi.Model.Types.Base; namespace Substrate.NetApi.TestNode { public abstract class NodeTest { - protected const string WebSocketUrl = "ws://rpc-parachain.bajun.network"; + //protected const string WebSocketUrl = "wss://rpc-paseo.bajun.network"; + //protected const string WebSocketUrl = "wss://rpc-parachain.bajun.network"; + protected const string WebSocketUrl = "wss://polkadot-rpc.dwellir.com"; protected SubstrateClient _substrateClient; @@ -43,14 +46,13 @@ public void DisposeClient() /// Return the 20th hash block from now (totally arbitrary) /// /// - protected async Task GivenBlockAsync() + protected async Task GivenBlockAsync() { var lastBlockData = await _substrateClient.Chain.GetBlockAsync(); var lastBlockNumber = lastBlockData.Block.Header.Number.Value; - var blockNumber = new Model.Types.Base.BlockNumber(); - blockNumber.Create((uint)(lastBlockNumber - 20)); - return (await _substrateClient.Chain.GetBlockHashAsync(blockNumber)).Bytes; + var blockNumber = new BlockNumber((uint)(lastBlockNumber - 20)); + return await _substrateClient.Chain.GetBlockHashAsync(blockNumber); } } } diff --git a/Substrate.NetApi/Attributes/SubstrateNodeType.cs b/Substrate.NetApi/Attributes/SubstrateNodeType.cs index 8c4e87d..604fde4 100644 --- a/Substrate.NetApi/Attributes/SubstrateNodeType.cs +++ b/Substrate.NetApi/Attributes/SubstrateNodeType.cs @@ -1,5 +1,5 @@ using System; -using Substrate.NetApi.Model.Types.Metadata.V14; +using Substrate.NetApi.Model.Types.Metadata.Base; namespace Substrate.NetApi.Attributes { diff --git a/Substrate.NetApi/Model/Extrinsics/ChargeAssetTxPayment.cs b/Substrate.NetApi/Model/Extrinsics/ChargeAssetTxPayment.cs index 38ee08f..8957132 100644 --- a/Substrate.NetApi/Model/Extrinsics/ChargeAssetTxPayment.cs +++ b/Substrate.NetApi/Model/Extrinsics/ChargeAssetTxPayment.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; namespace Substrate.NetApi.Model.Extrinsics { @@ -7,7 +8,31 @@ namespace Substrate.NetApi.Model.Extrinsics /// Charge Type /// public abstract class ChargeType : BaseType - { } + { + } + + /// + /// Asset Identifier for AssetHubs and the Ajuna Chain. + /// + public enum NativeOrWithId + { + /// + /// Native token. However, in the `ChargeAssetTxPayment` this is unused, as the none implies the Native asset. + /// + Native = 0, + /// + /// Some asset with a corresponding asset should be used for payment. + /// + WithId = 1, + } + + /// + /// Asset Identifier for AssetHubs and the Ajuna Chain. + /// + public sealed class EnumNativeOrWithId : BaseEnumExt + { + } + /// /// Charge Asset Tx Payment @@ -15,17 +40,17 @@ public abstract class ChargeType : BaseType public class ChargeAssetTxPayment : ChargeType { private CompactInteger _tip; - private CompactInteger _assetId; + private BaseOpt _assetId; /// /// Charge Asset Tx Payment Constructor /// /// - /// - public ChargeAssetTxPayment(CompactInteger tip, CompactInteger asset) + /// + public ChargeAssetTxPayment(CompactInteger tip, BaseOpt assetId) { _tip = tip; - _assetId = asset; + _assetId = assetId; } /// @@ -36,7 +61,7 @@ public override byte[] Encode() // Tip bytes.AddRange(_tip.Encode()); - // Asset Id + // AssetId bytes.AddRange(_assetId.Encode()); return bytes.ToArray(); @@ -46,7 +71,8 @@ public override byte[] Encode() public override void Decode(byte[] byteArray, ref int p) { _tip = CompactInteger.Decode(byteArray, ref p); - _assetId = CompactInteger.Decode(byteArray, ref p); + _assetId = new BaseOpt(); + _assetId.Decode(byteArray, ref p); } /// @@ -55,7 +81,21 @@ public override void Decode(byte[] byteArray, ref int p) /// public static ChargeAssetTxPayment Default() { - return new ChargeAssetTxPayment(0, 0); + return new ChargeAssetTxPayment(0, new BaseOpt()); + } + + /// + /// Defines extrinsic payment with the asset id + /// + /// + /// + /// + public static ChargeAssetTxPayment NewWithAsset(CompactInteger tip, U32 assetId) + { + var asset = new EnumNativeOrWithId(); + asset.Create(NativeOrWithId.WithId, assetId); + + return new ChargeAssetTxPayment(tip, new BaseOpt(asset)); } } diff --git a/Substrate.NetApi/Model/Extrinsics/CheckMetadataHash.cs b/Substrate.NetApi/Model/Extrinsics/CheckMetadataHash.cs new file mode 100644 index 0000000..d7085af --- /dev/null +++ b/Substrate.NetApi/Model/Extrinsics/CheckMetadataHash.cs @@ -0,0 +1,76 @@ +using Substrate.NetApi.Model.Types.Base; +using System; + +namespace Substrate.NetApi.Model.Extrinsics +{ + + /// + /// If the runtime should expect a metadata hash that has been signed in the additional signed. + /// + public enum Mode + { + /// + /// `None` has been signed in the CheckMetadataHash additional signed. + /// + Disabled, + /// + /// `Some(MetadataHash)` has been signed in the CheckMetadataHash additional signed. + /// + Enabled + } + /// + /// CheckMetadataHash signed extension. + /// + public class CheckMetadataHash: BaseType + { + private Mode _mode; + + /// + /// Initialize with `Mode.Disabled`. + /// + public CheckMetadataHash() { + // Don't allow enabling the mode, as we don't support it. + _mode = Mode.Disabled; + } + + /// + /// Corresponds to the `Extra` that is sent with the extrinsic. + /// + /// + public override byte[] Encode() + { + return EncodeExtra(); + } + + /// + /// Corresponds to the extra that _is_ sent with the extrinsic. + /// + /// + public byte[] EncodeExtra() + { + return new BaseEnum(_mode).Encode(); + } + + /// + /// Corresponds to the `Additional` that is signed, but _not_ sent with the extrinsic. + /// + /// + public byte[] EncodeAdditional() + { + // We provide no metadata hash in the signer payload to align with the above. + return new byte[1]; + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + uint modeByte = byteArray[p++]; + + if (modeByte > 1) { + throw new ArgumentException($"{modeByte} is not a valid representation of CheckMetadata Mode."); + } + + _mode = modeByte == 0 ? Mode.Disabled : Mode.Enabled; + } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Extrinsics/Extrinsic.cs b/Substrate.NetApi/Model/Extrinsics/Extrinsic.cs index fd9d3cc..e689ad4 100644 --- a/Substrate.NetApi/Model/Extrinsics/Extrinsic.cs +++ b/Substrate.NetApi/Model/Extrinsics/Extrinsic.cs @@ -44,6 +44,11 @@ public class Extrinsic /// Method /// public Method Method { get; set; } + + /// + /// CheckMetadataHash + /// + public CheckMetadataHash CheckMetadataHash { get; set; } /// /// Signature @@ -124,6 +129,9 @@ internal Extrinsic(Memory memory, ChargeType chargeType) // charge type Charge = chargeType; Charge.Decode(memory.ToArray(), ref p); + + CheckMetadataHash = new CheckMetadataHash(); + CheckMetadataHash.Decode(memory.ToArray(), ref p); } // method @@ -154,6 +162,7 @@ public Extrinsic(bool signed, Account account, CompactInteger nonce, Method meth Era = era; Nonce = nonce; Charge = charge; + CheckMetadataHash = new CheckMetadataHash(); Method = method; } @@ -176,6 +185,7 @@ public byte[] Encode() result.AddRange(Era.Encode()); result.AddRange(Nonce.Encode()); result.AddRange(Charge.Encode()); + result.AddRange(CheckMetadataHash.EncodeExtra()); } result.AddRange(Method.Encode()); diff --git a/Substrate.NetApi/Model/Extrinsics/SignedExtensions.cs b/Substrate.NetApi/Model/Extrinsics/SignedExtensions.cs index bc6bc5c..3e59f29 100644 --- a/Substrate.NetApi/Model/Extrinsics/SignedExtensions.cs +++ b/Substrate.NetApi/Model/Extrinsics/SignedExtensions.cs @@ -42,6 +42,11 @@ public class SignedExtensions /// Charge /// public ChargeType Charge { get; } + + /// + /// CheckMetadataHash; only disabled supported for now. + /// + public CheckMetadataHash MetadataHashSignedExt { get; } /// /// Initializes a new instance of the class. @@ -62,6 +67,7 @@ public SignedExtensions(uint specVersion, uint txVersion, Hash genesis, Hash sta Mortality = mortality; Nonce = nonce; Charge = charge; + MetadataHashSignedExt = new CheckMetadataHash(); } /// @@ -80,6 +86,9 @@ public byte[] GetExtra() // ChargeType bytes.AddRange(Charge.Encode()); + + // CheckMetadataHash + bytes.AddRange(MetadataHashSignedExt.EncodeExtra()); return bytes.ToArray(); } @@ -103,6 +112,9 @@ public byte[] GetAdditionalSigned() // CheckMortality, Additional Blockhash check. Immortal = genesis_hash, Mortal = logic bytes.AddRange(StartEra.Bytes); + + // CheckMetadataHash + bytes.AddRange(MetadataHashSignedExt.EncodeAdditional()); return bytes.ToArray(); } diff --git a/Substrate.NetApi/Model/Extrinsics/UnCheckedExtrinsic.cs b/Substrate.NetApi/Model/Extrinsics/UnCheckedExtrinsic.cs index 2175740..ab8d809 100644 --- a/Substrate.NetApi/Model/Extrinsics/UnCheckedExtrinsic.cs +++ b/Substrate.NetApi/Model/Extrinsics/UnCheckedExtrinsic.cs @@ -93,8 +93,10 @@ public void AddPayloadSignature(byte[] signature) list.AddRange(Charge.Encode()); + list.AddRange(CheckMetadataHash.EncodeExtra()); + list.AddRange(Method.Encode()); - + return Utils.SizePrefixedByteArray(list); } } diff --git a/Substrate.NetApi/Model/Meta/MetaData.cs b/Substrate.NetApi/Model/Meta/MetaData.cs index 54b4142..f85d2fe 100644 --- a/Substrate.NetApi/Model/Meta/MetaData.cs +++ b/Substrate.NetApi/Model/Meta/MetaData.cs @@ -4,7 +4,10 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Substrate.NetApi.Model.Types.Metadata; +using Substrate.NetApi.Model.Types.Metadata.Base; +using Substrate.NetApi.Model.Types.Metadata.Base.Portable; using Substrate.NetApi.Model.Types.Metadata.V14; +using Substrate.NetApi.Model.Types.Metadata.V15; namespace Substrate.NetApi.Model.Meta { @@ -13,12 +16,18 @@ namespace Substrate.NetApi.Model.Meta /// public class MetaData { + /// + /// Meta Data Constructor + /// + public MetaData() + { } + /// /// Meta Data Constructor /// /// /// - public MetaData(RuntimeMetadata rtmd, string origin = "unknown") + public MetaData(RuntimeMetadata rtmd, string origin = "unknown") { Origin = origin; Magic = Utils.Bytes2HexString(rtmd.MetaDataInfo.Magic.Bytes); @@ -255,7 +264,7 @@ public static Dictionary CreateNodeTypeDict(PortableType[] types /// /// /// - public static Dictionary CreateModuleDict(PalletMetadata[] modules) + public static Dictionary CreateModuleDict(PalletMetadataV14[] modules) { var result = new Dictionary(); @@ -286,7 +295,7 @@ public static Dictionary CreateModuleDict(PalletMetadata[] m Modifier = entry.StorageModifier.Value, StorageType = entry.StorageType.Value, Default = entry.StorageDefault.Value.Select(p => p.Value).ToArray(), - Docs = entry.Documentation.Value.Select(p => p.Value).ToArray(), + Docs = entry.Docs.Value.Select(p => p.Value).ToArray(), }; switch (entry.StorageType.Value) @@ -339,7 +348,7 @@ public static Dictionary CreateModuleDict(PalletMetadata[] m Name = constant.ConstantName.Value, TypeId = (uint)constant.ConstantType.Value, Value = constant.ConstantValue.Value.Select(p => p.Value).ToArray(), - Docs = constant.Documentation.Value.Select(p => p.Value).ToArray() + Docs = constant.Docs.Value.Select(p => p.Value).ToArray() }; } @@ -361,7 +370,7 @@ public static Dictionary CreateModuleDict(PalletMetadata[] m /// /// /// - private static ExtrinsicMetadata CreateExtrinsic(ExtrinsicMetadataStruct extrinsic) + private static ExtrinsicMetadata CreateExtrinsic(ExtrinsicMetadataV14 extrinsic) { return new ExtrinsicMetadata() { diff --git a/Substrate.NetApi/Model/Meta/MetadataTree.cs b/Substrate.NetApi/Model/Meta/MetadataTree.cs index 8d531ef..ed493a2 100644 --- a/Substrate.NetApi/Model/Meta/MetadataTree.cs +++ b/Substrate.NetApi/Model/Meta/MetadataTree.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using Newtonsoft.Json; using Newtonsoft.Json.Converters; -using Substrate.NetApi.Model.Types.Metadata.V14; +using Substrate.NetApi.Model.Types.Metadata.Base; namespace Substrate.NetApi.Model.Meta { diff --git a/Substrate.NetApi/Model/Rpc/TransactionEventInfo.cs b/Substrate.NetApi/Model/Rpc/TransactionEventInfo.cs index eade048..702d144 100644 --- a/Substrate.NetApi/Model/Rpc/TransactionEventInfo.cs +++ b/Substrate.NetApi/Model/Rpc/TransactionEventInfo.cs @@ -12,11 +12,6 @@ public enum TransactionEvent /// Validated, - /// - /// The broadcasted event indicates the number of other peers this transaction has been broadcasted to. - /// - Broadcasted, - /// /// The bestChainBlockIncluded event indicates which block of the best chain the transaction is included in. /// diff --git a/Substrate.NetApi/Model/Types/Base/BaseEnumExt2.cs b/Substrate.NetApi/Model/Types/Base/BaseEnumExt2.cs index 3e2acb7..1dee48b 100644 --- a/Substrate.NetApi/Model/Types/Base/BaseEnumExt2.cs +++ b/Substrate.NetApi/Model/Types/Base/BaseEnumExt2.cs @@ -57545,9077 +57545,4 @@ public void Create(T0 t, IType value2) /// 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() - { - /// - 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; } - } - /// - 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 - 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() - where T256 : 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); - case 0xFF: 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 new file mode 100644 index 0000000..51e13d7 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Base/BaseEnumExt3.cs @@ -0,0 +1,9088 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System; +using System.Collections.Generic; + +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 + 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() + where T256 : 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); + case 0xFF: 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/BaseEnumRust.cs b/Substrate.NetApi/Model/Types/Base/BaseEnumRust.cs new file mode 100644 index 0000000..980ae03 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Base/BaseEnumRust.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; + +namespace Substrate.NetApi.Model.Types.Base +{ + /// + /// Next version of BaseEnumExt to support Rust enums + /// + /// + public class BaseEnumRust : BaseType where TEnum : Enum + { + private readonly Dictionary>> _typeDecoders; + + /// + /// Constructor + /// + public BaseEnumRust() + { + _typeDecoders = new Dictionary>>(); + } + + /// + /// Constructor + /// + public BaseEnumRust(Dictionary typeDecoderMap) + { + _typeDecoders = new Dictionary>>(); + foreach (var decoder in typeDecoderMap) + { + var enumValue = decoder.Key; + var type = decoder.Value; + + _typeDecoders.Add(enumValue, (byteArray, p) => + { + var typeInstance = (IType)Activator.CreateInstance(type); + typeInstance.Decode(byteArray, ref p); + return new Tuple(typeInstance, p); + }); + } + } + + /// + /// Add a type decoder + /// + /// + /// + public void AddTypeDecoder(TEnum enumValue) where TType : IType, new() + { + _typeDecoders.Add(enumValue, (byteArray, p) => + { + var typeInstance = new TType(); + typeInstance.Decode(byteArray, ref p); + return new Tuple(typeInstance, p); + }); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + var enumByte = byteArray[p]; + p += 1; + + try + { + Value = (TEnum)Enum.Parse(typeof(TEnum), enumByte.ToString(), true); + } + catch (ArgumentException ex) + { + throw new Exception($"Invalid enum value: {enumByte}", ex); + } + + if (_typeDecoders.TryGetValue(Value, out var decoder)) + { + var result = decoder(byteArray, p); + Value2 = result.Item1; + p = result.Item2; + } + else + { + throw new Exception($"No decoder found for enum byte {enumByte}"); + } + + TypeSize = p - start; + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, start, Bytes, 0, TypeSize); + } + + /// + public override byte[] Encode() + { + return Bytes; + } + + /// + /// Create from enum and it's value + /// + /// + /// + public void Create(TEnum t, IType iType) + { + var enumByte = Convert.ToByte(t); + + if (!_typeDecoders.ContainsKey(t)) + { + throw new Exception($"No decoder found for enum byte {enumByte}, make sure to use BaseVoid, if there is no value."); + } + + Value = t; + Value2 = iType; + + // Encode the enum byte and IType + var bytes = new List { enumByte }; + bytes.AddRange(iType.Encode()); + Bytes = bytes.ToArray(); + } + + /// + /// Create from enum only with BaseVoid + /// + /// + public void Create(TEnum t) + { + Create(t, new BaseVoid()); + } + + /// + public TEnum Value { get; set; } + /// + public IType Value2 { get; set; } + } +} diff --git a/Substrate.NetApi/Model/Types/Base/BaseTuple.cs b/Substrate.NetApi/Model/Types/Base/BaseTuple.cs index 8215bf1..b03a932 100644 --- a/Substrate.NetApi/Model/Types/Base/BaseTuple.cs +++ b/Substrate.NetApi/Model/Types/Base/BaseTuple.cs @@ -13,11 +13,13 @@ public override string TypeName() { return "(" + ")"; } + /// public override byte[] Encode() { return new byte[0]; } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -50,12 +52,14 @@ public BaseTuple(T1 t1) { Create(t1); } + /// public override string TypeName() { return "(" + new T1().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -66,6 +70,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -123,6 +128,7 @@ public BaseTuple(T1 t1, T2 t2) { Create(t1, t2); } + /// public override string TypeName() { @@ -130,6 +136,7 @@ public override string TypeName() new T1().TypeName() + "," + new T2().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -140,6 +147,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -202,6 +210,7 @@ public BaseTuple(T1 t1, T2 t2, T3 t3) { Create(t1, t2, t3); } + /// public override string TypeName() { @@ -210,6 +219,7 @@ public override string TypeName() new T2().TypeName() + "," + new T3().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -220,6 +230,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -309,6 +320,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -380,6 +392,7 @@ public override string TypeName() new T4().TypeName() + "," + new T5().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -390,6 +403,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -468,6 +482,7 @@ public override string TypeName() new T5().TypeName() + "," + new T6().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -478,6 +493,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -563,6 +579,7 @@ public override string TypeName() new T6().TypeName() + "," + new T7().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -573,6 +590,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -665,6 +683,7 @@ public override string TypeName() new T7().TypeName() + "," + new T8().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -675,6 +694,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -774,6 +794,7 @@ public override string TypeName() new T8().TypeName() + "," + new T9().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -784,6 +805,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -890,6 +912,7 @@ public override string TypeName() new T9().TypeName() + "," + new T10().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -900,6 +923,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -2595,7 +2619,7 @@ public void Create(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9 /// public IType[] Value { get; internal set; } } - + /// /// Base class for multiple tuples type /// @@ -3059,6 +3083,7 @@ public override string TypeName() new T22().TypeName() + "," + new T23().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -3069,6 +3094,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -3273,6 +3299,7 @@ public override string TypeName() new T23().TypeName() + "," + new T24().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -3283,6 +3310,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -3494,6 +3522,7 @@ public override string TypeName() new T24().TypeName() + "," + new T25().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -3504,6 +3533,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -3722,6 +3752,7 @@ public override string TypeName() new T25().TypeName() + "," + new T26().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -3732,6 +3763,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -3957,6 +3989,7 @@ public override string TypeName() new T26().TypeName() + "," + new T27().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -3967,6 +4000,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -4199,6 +4233,7 @@ public override string TypeName() new T27().TypeName() + "," + new T28().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -4209,6 +4244,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -4448,6 +4484,7 @@ public override string TypeName() new T28().TypeName() + "," + new T29().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -4458,6 +4495,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -4704,9 +4742,9 @@ public override string TypeName() new T29().TypeName() + "," + new T30().TypeName() + ")"; } - - /// - public override byte[] Encode() + + /// + public override byte[] Encode() { var result = new List(); foreach (var v in Value) @@ -4715,6 +4753,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -4968,6 +5007,7 @@ public override string TypeName() new T30().TypeName() + "," + new T31().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -4978,6 +5018,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -5238,6 +5279,7 @@ public override string TypeName() new T31().TypeName() + "," + new T32().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -5248,6 +5290,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -5515,6 +5558,7 @@ public override string TypeName() new T32().TypeName() + "," + new T33().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -5525,6 +5569,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -5799,6 +5844,7 @@ public override string TypeName() new T33().TypeName() + "," + new T34().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -5809,6 +5855,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -6090,6 +6137,7 @@ public override string TypeName() new T34().TypeName() + "," + new T35().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -6100,6 +6148,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -6388,6 +6437,7 @@ public override string TypeName() new T35().TypeName() + "," + new T36().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -6398,6 +6448,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -6693,6 +6744,7 @@ public override string TypeName() new T36().TypeName() + "," + new T37().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -6703,6 +6755,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -7005,6 +7058,7 @@ public override string TypeName() new T37().TypeName() + "," + new T38().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -7015,6 +7069,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { @@ -7324,6 +7379,7 @@ public override string TypeName() new T38().TypeName() + "," + new T39().TypeName() + ")"; } + /// public override byte[] Encode() { @@ -7334,6 +7390,7 @@ public override byte[] Encode() } return result.ToArray(); } + /// public override void Decode(byte[] byteArray, ref int p) { diff --git a/Substrate.NetApi/Model/Types/Base/BaseTupleRust.cs b/Substrate.NetApi/Model/Types/Base/BaseTupleRust.cs new file mode 100644 index 0000000..04d3b45 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Base/BaseTupleRust.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace Substrate.NetApi.Model.Types.Base +{ + /// + /// Base Tuple Rust, used to represent a tuple in Rust + /// + public class BaseTupleRust : BaseType + { + /// + /// Tuple Types + /// + private Type[] _types; + + /// + /// Constructor + /// + public BaseTupleRust() + { + } + + /// + /// Constructor + /// + /// + public BaseTupleRust(params Type[] types) + { + _types = types; + } + + /// + /// Constructor + /// + /// + public BaseTupleRust(params IType[] iTypes) + { + Create(iTypes); + } + + /// + public override string TypeName() + { + return "(" + string.Join(",", Value.Select(v => v.TypeName())) + ")"; + } + + /// + public override byte[] Encode() + { + var result = new List(); + foreach (var v in Value) + { + result.AddRange(v.Encode()); + } + return result.ToArray(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + Value = new IType[_types.Length]; + int o = p; + for (int i = 0; i < _types.Length; i++) + { + var instance = (IType)Activator.CreateInstance(_types[i]); + instance.Decode(byteArray, ref p); + Value[i] = instance; + } + TypeSize = p - o; + Bytes = new byte[TypeSize]; + Array.Copy(byteArray, o, Bytes, 0, TypeSize); + } + + /// + /// Create a new instance of BaseTupleRust + /// + /// + public void Create(params IType[] elements) + { + Value = elements; + var byteList = new List(); + var typeList = new List(); + foreach (var element in elements) + { + byteList.AddRange(element.Encode()); + typeList.Add(element.GetType()); + } + _types = typeList.ToArray(); + Bytes = byteList.ToArray(); + TypeSize = Bytes.Length; + } + + /// + /// Tuple Value + /// + public IType[] Value { get; internal set; } + } +} diff --git a/Substrate.NetApi/Model/Types/Metadata/Base/ByteGetter.cs b/Substrate.NetApi/Model/Types/Metadata/Base/ByteGetter.cs new file mode 100644 index 0000000..acfffbd --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/Base/ByteGetter.cs @@ -0,0 +1,12 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; + +namespace Substrate.NetApi.Model.Types.Metadata.Base +{ + /// + /// Byte Getter + /// + public class ByteGetter : BaseVec + { + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/Base/ErrorMetadata.cs b/Substrate.NetApi/Model/Types/Metadata/Base/ErrorMetadata.cs new file mode 100644 index 0000000..42de5da --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/Base/ErrorMetadata.cs @@ -0,0 +1,34 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.V14 +{ + /// + /// Error Metadata + /// + public class ErrorMetadata : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + ErrorType = new TType(); + ErrorType.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Error Type + /// + public TType ErrorType { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V14/Field.cs b/Substrate.NetApi/Model/Types/Metadata/Base/Field.cs similarity index 93% rename from Substrate.NetApi/Model/Types/Metadata/V14/Field.cs rename to Substrate.NetApi/Model/Types/Metadata/Base/Field.cs index d6a6052..e9d6a41 100644 --- a/Substrate.NetApi/Model/Types/Metadata/V14/Field.cs +++ b/Substrate.NetApi/Model/Types/Metadata/Base/Field.cs @@ -1,6 +1,7 @@ -using System; -using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; using Substrate.NetApi.Model.Types.Primitive; +using System; namespace Substrate.NetApi.Model.Types.Metadata.V14 { diff --git a/Substrate.NetApi/Model/Types/Metadata/Base/MetaDataInfo.cs b/Substrate.NetApi/Model/Types/Metadata/Base/MetaDataInfo.cs new file mode 100644 index 0000000..6f5dbfc --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/Base/MetaDataInfo.cs @@ -0,0 +1,46 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.Base +{ + /// + /// Meta Data Info Type + /// + public class MetaDataInfo : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + /// Decode from byte array + /// + /// + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + Magic = new U32(); + Magic.Decode(byteArray, ref p); + + Version = new U8(); + Version.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Magic + /// + public U32 Magic { get; private set; } + + /// + /// Version + /// + public U8 Version { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/Base/PalletCallMetadata.cs b/Substrate.NetApi/Model/Types/Metadata/Base/PalletCallMetadata.cs new file mode 100644 index 0000000..ca32fc0 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/Base/PalletCallMetadata.cs @@ -0,0 +1,33 @@ +using Substrate.NetApi.Model.Types.Base; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.Base +{ + /// + /// Pallet Call Metadata + /// + public class PalletCallMetadata : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + CallType = new TType(); + CallType.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Call Type + /// + public TType CallType { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/Base/PalletConstantMetadata.cs b/Substrate.NetApi/Model/Types/Metadata/Base/PalletConstantMetadata.cs new file mode 100644 index 0000000..2221460 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/Base/PalletConstantMetadata.cs @@ -0,0 +1,67 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.V14 +{ + /// + /// Pallet Constant Metadata + /// + public class PalletConstantMetadata : BaseType + { + /// + /// Encode to Bytes + /// + /// + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + /// Decode from a byte array at certain position + /// + /// + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + ConstantName = new Str(); + ConstantName.Decode(byteArray, ref p); + + ConstantType = new TType(); + ConstantType.Decode(byteArray, ref p); + + ConstantValue = new ByteGetter(); + ConstantValue.Decode(byteArray, ref p); + + Docs = new BaseVec(); + Docs.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Constant Name + /// + public Str ConstantName { get; private set; } + + /// + /// Constant Type + /// + public TType ConstantType { get; private set; } + + /// + /// Constant Value + /// + public ByteGetter ConstantValue { get; private set; } + + /// + /// Docs + /// + public BaseVec Docs { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/Base/PalletEventMetadata.cs b/Substrate.NetApi/Model/Types/Metadata/Base/PalletEventMetadata.cs new file mode 100644 index 0000000..6d6c89f --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/Base/PalletEventMetadata.cs @@ -0,0 +1,34 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.V14 +{ + /// + /// Palette Event Metadata + /// + public class PalletEventMetadata : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + EventType = new TType(); + EventType.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Event Type + /// + public TType EventType { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V14/PortableRegistry.cs b/Substrate.NetApi/Model/Types/Metadata/Base/Portable/PortableRegistry.cs similarity index 81% rename from Substrate.NetApi/Model/Types/Metadata/V14/PortableRegistry.cs rename to Substrate.NetApi/Model/Types/Metadata/Base/Portable/PortableRegistry.cs index 09a60af..a4f4c50 100644 --- a/Substrate.NetApi/Model/Types/Metadata/V14/PortableRegistry.cs +++ b/Substrate.NetApi/Model/Types/Metadata/Base/Portable/PortableRegistry.cs @@ -1,6 +1,6 @@ using Substrate.NetApi.Model.Types.Base; -namespace Substrate.NetApi.Model.Types.Metadata.V14 +namespace Substrate.NetApi.Model.Types.Metadata.Base.Portable { /// /// Portable Registry diff --git a/Substrate.NetApi/Model/Types/Metadata/V14/PortableType.cs b/Substrate.NetApi/Model/Types/Metadata/Base/Portable/PortableType.cs similarity index 85% rename from Substrate.NetApi/Model/Types/Metadata/V14/PortableType.cs rename to Substrate.NetApi/Model/Types/Metadata/Base/Portable/PortableType.cs index 76d5d1f..fcbfaed 100644 --- a/Substrate.NetApi/Model/Types/Metadata/V14/PortableType.cs +++ b/Substrate.NetApi/Model/Types/Metadata/Base/Portable/PortableType.cs @@ -1,8 +1,9 @@ -using System; -using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.V14; using Substrate.NetApi.Model.Types.Primitive; +using System; -namespace Substrate.NetApi.Model.Types.Metadata.V14 +namespace Substrate.NetApi.Model.Types.Metadata.Base.Portable { /// /// Portable Type @@ -37,7 +38,7 @@ public override void Decode(byte[] byteArray, ref int p) /// Id /// public U32 Id { get; private set; } - + /// /// Ty /// diff --git a/Substrate.NetApi/Model/Types/Metadata/V14/TypePortableForm.cs b/Substrate.NetApi/Model/Types/Metadata/Base/Portable/TypePortableForm.cs similarity index 96% rename from Substrate.NetApi/Model/Types/Metadata/V14/TypePortableForm.cs rename to Substrate.NetApi/Model/Types/Metadata/Base/Portable/TypePortableForm.cs index 13e90f0..870091d 100644 --- a/Substrate.NetApi/Model/Types/Metadata/V14/TypePortableForm.cs +++ b/Substrate.NetApi/Model/Types/Metadata/Base/Portable/TypePortableForm.cs @@ -1,6 +1,7 @@ -using System; -using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; using Substrate.NetApi.Model.Types.Primitive; +using System; namespace Substrate.NetApi.Model.Types.Metadata.V14 { @@ -52,7 +53,7 @@ public override void Decode(byte[] byteArray, ref int p) /// Type Definition /// public BaseEnumExt, TypeDefCompact, TypeDefBitSequence, BaseVoid> TypeDef { get; private set; } - + /// /// Docs /// diff --git a/Substrate.NetApi/Model/Types/Metadata/Base/SignedExtensionMetadataStruct.cs b/Substrate.NetApi/Model/Types/Metadata/Base/SignedExtensionMetadataStruct.cs new file mode 100644 index 0000000..8980a7a --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/Base/SignedExtensionMetadataStruct.cs @@ -0,0 +1,53 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.Base +{ + /// + /// Signed Extension Metadata Struct + /// + public class SignedExtensionMetadataStruct : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + SignedIdentifier = new Str(); + SignedIdentifier.Decode(byteArray, ref p); + + SignedExtType = new TType(); + SignedExtType.Decode(byteArray, ref p); + + AddSignedExtType = new TType(); + AddSignedExtType.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Signed Identifier + /// The unique signed extension identifier, which may be different from the type name. + /// + public Str SignedIdentifier { get; private set; } + + /// + /// Signed Extension Type + /// The type of the signed extension, with the data to be included in the extrinsic. + /// + public TType SignedExtType { get; private set; } + + /// + /// Add Signed Extension Type + /// The type of the additional signed data, with the data to be included in the signed payload + /// + public TType AddSignedExtType { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/Base/StorageEntryMetadata.cs b/Substrate.NetApi/Model/Types/Metadata/Base/StorageEntryMetadata.cs new file mode 100644 index 0000000..e9e56bc --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/Base/StorageEntryMetadata.cs @@ -0,0 +1,68 @@ +using Substrate.NetApi.Model.Meta; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; +using static Substrate.NetApi.Model.Meta.Storage; + +namespace Substrate.NetApi.Model.Types.Metadata.Base +{ + /// + /// Storage Entry Metadata + /// + public class StorageEntryMetadata : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + StorageName = new Str(); + StorageName.Decode(byteArray, ref p); + + StorageModifier = new BaseEnum(); + StorageModifier.Decode(byteArray, ref p); + + StorageType = new BaseEnumExt(); + StorageType.Decode(byteArray, ref p); + + StorageDefault = new ByteGetter(); + StorageDefault.Decode(byteArray, ref p); + + Docs = new BaseVec(); + Docs.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Storage Name + /// + public Str StorageName { get; private set; } + + /// + /// Storage Modifier + /// + public BaseEnum StorageModifier { get; private set; } + + /// + /// Storage Type + /// + public BaseEnumExt StorageType { get; private set; } + + /// + /// Storage Default + /// + public ByteGetter StorageDefault { get; private set; } + + /// + /// Docs + /// + public BaseVec Docs { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/Base/StorageEntryTypeMap.cs b/Substrate.NetApi/Model/Types/Metadata/Base/StorageEntryTypeMap.cs new file mode 100644 index 0000000..e609893 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/Base/StorageEntryTypeMap.cs @@ -0,0 +1,50 @@ +using Substrate.NetApi.Model.Types.Base; +using System; +using static Substrate.NetApi.Model.Meta.Storage; + +namespace Substrate.NetApi.Model.Types.Metadata.Base +{ + /// + /// Storage Entry Type Map + /// + public class StorageEntryTypeMap : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + Hashers = new BaseVec>(); + Hashers.Decode(byteArray, ref p); + + Key = new TType(); + Key.Decode(byteArray, ref p); + + Value = new TType(); + Value.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Hashers + /// + public BaseVec> Hashers { get; private set; } + + /// + /// Key + /// + public TType Key { get; private set; } + + /// + /// Value + /// + public TType Value { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/Base/StorageMetadata.cs b/Substrate.NetApi/Model/Types/Metadata/Base/StorageMetadata.cs new file mode 100644 index 0000000..feb9417 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/Base/StorageMetadata.cs @@ -0,0 +1,42 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.Base +{ + /// + /// Storage Metadata + /// + public class StorageMetadata : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + Prefix = new Str(); + Prefix.Decode(byteArray, ref p); + + Entries = new BaseVec(); + Entries.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Prefix + /// + public Str Prefix { get; private set; } + + /// + /// Entries + /// + public BaseVec Entries { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V14/TypeDefs.cs b/Substrate.NetApi/Model/Types/Metadata/Base/TypeDefs.cs similarity index 98% rename from Substrate.NetApi/Model/Types/Metadata/V14/TypeDefs.cs rename to Substrate.NetApi/Model/Types/Metadata/Base/TypeDefs.cs index 3b75726..4f2cfde 100644 --- a/Substrate.NetApi/Model/Types/Metadata/V14/TypeDefs.cs +++ b/Substrate.NetApi/Model/Types/Metadata/Base/TypeDefs.cs @@ -1,9 +1,10 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.V14; using Substrate.NetApi.Model.Types.Primitive; +using System; -namespace Substrate.NetApi.Model.Types.Metadata.V14 +namespace Substrate.NetApi.Model.Types.Metadata.Base { /// /// Compact Integer Type @@ -252,7 +253,7 @@ public override void Decode(byte[] byteArray, ref int p) /// Len /// public U32 Len { get; private set; } - + /// /// Type Param /// @@ -404,7 +405,7 @@ public override void Decode(byte[] byteArray, ref int p) /// Bit Store Type /// public TType BitStoreType { get; private set; } - + /// /// Bit Order Type /// diff --git a/Substrate.NetApi/Model/Types/Metadata/V14/Variant.cs b/Substrate.NetApi/Model/Types/Metadata/Base/Variant.cs similarity index 89% rename from Substrate.NetApi/Model/Types/Metadata/V14/Variant.cs rename to Substrate.NetApi/Model/Types/Metadata/Base/Variant.cs index 750bf67..025c666 100644 --- a/Substrate.NetApi/Model/Types/Metadata/V14/Variant.cs +++ b/Substrate.NetApi/Model/Types/Metadata/Base/Variant.cs @@ -1,8 +1,9 @@ -using System; -using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.V14; using Substrate.NetApi.Model.Types.Primitive; +using System; -namespace Substrate.NetApi.Model.Types.Metadata.V14 +namespace Substrate.NetApi.Model.Types.Metadata.Base { /// /// Variant Type diff --git a/Substrate.NetApi/Model/Types/Metadata/RuntimeMetadata.cs b/Substrate.NetApi/Model/Types/Metadata/RuntimeMetadata.cs index fa2e914..9c5684a 100644 --- a/Substrate.NetApi/Model/Types/Metadata/RuntimeMetadata.cs +++ b/Substrate.NetApi/Model/Types/Metadata/RuntimeMetadata.cs @@ -1,13 +1,13 @@ -using System; -using Substrate.NetApi.Model.Types.Base; -using Substrate.NetApi.Model.Types.Metadata.V14; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; +using System; namespace Substrate.NetApi.Model.Types.Metadata { /// /// Runtime Metadata Type /// - public class RuntimeMetadata : BaseType + public class RuntimeMetadata : BaseType where T : BaseType, new() { /// public override string TypeName() => "RuntimeMetadata"; @@ -26,7 +26,7 @@ public override void Decode(byte[] byteArray, ref int p) MetaDataInfo = new MetaDataInfo(); MetaDataInfo.Decode(byteArray, ref p); - RuntimeMetadataData = new RuntimeMetadataV14(); + RuntimeMetadataData = new T(); RuntimeMetadataData.Decode(byteArray, ref p); TypeSize = p - start; @@ -36,10 +36,10 @@ public override void Decode(byte[] byteArray, ref int p) /// Meta Data Info /// public MetaDataInfo MetaDataInfo { get; private set; } - + /// /// Runtime Metadata Data /// - public RuntimeMetadataV14 RuntimeMetadataData { get; private set; } + public T RuntimeMetadataData { get; private set; } } } \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V14/ExtrinsicMetadataV14.cs b/Substrate.NetApi/Model/Types/Metadata/V14/ExtrinsicMetadataV14.cs new file mode 100644 index 0000000..0ad6eae --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/V14/ExtrinsicMetadataV14.cs @@ -0,0 +1,51 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.V14 +{ + /// + /// Extrinsic Metadata Struct + /// + public class ExtrinsicMetadataV14 : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + ExtrinsicType = new TType(); + ExtrinsicType.Decode(byteArray, ref p); + + Version = new U8(); + Version.Decode(byteArray, ref p); + + SignedExtensions = new BaseVec(); + SignedExtensions.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Extrinsic Type + /// + public TType ExtrinsicType { get; private set; } + + /// + /// Version + /// + public U8 Version { get; private set; } + + /// + /// Signed Extensions + /// + public BaseVec SignedExtensions { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V14/PalletMetadataV14.cs b/Substrate.NetApi/Model/Types/Metadata/V14/PalletMetadataV14.cs new file mode 100644 index 0000000..27add55 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/V14/PalletMetadataV14.cs @@ -0,0 +1,83 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.V14 +{ + /// + /// Palette Metadata + /// + public class PalletMetadataV14 : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + PalletName = new Str(); + PalletName.Decode(byteArray, ref p); + + PalletStorage = new BaseOpt(); + PalletStorage.Decode(byteArray, ref p); + + PalletCalls = new BaseOpt(); + PalletCalls.Decode(byteArray, ref p); + + PalletEvents = new BaseOpt(); + PalletEvents.Decode(byteArray, ref p); + + PalletConstants = new BaseVec(); + PalletConstants.Decode(byteArray, ref p); + + PalletErrors = new BaseOpt(); + PalletErrors.Decode(byteArray, ref p); + + Index = new U8(); + Index.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Palette Name + /// + public Str PalletName { get; private set; } + + /// + /// Palette Storage + /// + public BaseOpt PalletStorage { get; private set; } + + /// + /// Palette Calls + /// + public BaseOpt PalletCalls { get; private set; } + + /// + /// Palette Events + /// + public BaseOpt PalletEvents { get; private set; } + + /// + /// Palette Constants + /// + public BaseVec PalletConstants { get; private set; } + + /// + /// Palette Errors + /// + public BaseOpt PalletErrors { get; private set; } + + /// + /// Index + /// + public U8 Index { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V14/RuntimeMetadataV14.cs b/Substrate.NetApi/Model/Types/Metadata/V14/RuntimeMetadataV14.cs index 0c4a5ba..593e02f 100644 --- a/Substrate.NetApi/Model/Types/Metadata/V14/RuntimeMetadataV14.cs +++ b/Substrate.NetApi/Model/Types/Metadata/V14/RuntimeMetadataV14.cs @@ -1,8 +1,7 @@ -using System; -using Substrate.NetApi.Model.Meta; -using Substrate.NetApi.Model.Types.Base; -using Substrate.NetApi.Model.Types.Primitive; -using static Substrate.NetApi.Model.Meta.Storage; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; +using Substrate.NetApi.Model.Types.Metadata.Base.Portable; +using System; namespace Substrate.NetApi.Model.Types.Metadata.V14 { @@ -25,10 +24,10 @@ public override void Decode(byte[] byteArray, ref int p) Types = new PortableRegistry(); Types.Decode(byteArray, ref p); - Modules = new BaseVec(); + Modules = new BaseVec(); Modules.Decode(byteArray, ref p); - Extrinsic = new ExtrinsicMetadataStruct(); + Extrinsic = new ExtrinsicMetadataV14(); Extrinsic.Decode(byteArray, ref p); TypeId = new TType(); @@ -45,511 +44,16 @@ public override void Decode(byte[] byteArray, ref int p) /// /// Modules /// - public BaseVec Modules { get; private set; } + public BaseVec Modules { get; private set; } /// /// Extrinsic /// - public ExtrinsicMetadataStruct Extrinsic { get; private set; } + public ExtrinsicMetadataV14 Extrinsic { get; private set; } /// /// Type Id /// public TType TypeId { get; private set; } } - - /// - /// Meta Data Info Type - /// - public class MetaDataInfo : BaseType - { - /// - public override byte[] Encode() - { - throw new NotImplementedException(); - } - - /// - /// Decode from byte array - /// - /// - /// - public override void Decode(byte[] byteArray, ref int p) - { - var start = p; - - Magic = new U32(); - Magic.Decode(byteArray, ref p); - - Version = new U8(); - Version.Decode(byteArray, ref p); - - TypeSize = p - start; - } - - /// - /// Magic - /// - public U32 Magic { get; private set; } - - /// - /// Version - /// - public U8 Version { get; private set; } - } - - /// - /// Palette Metadata - /// - public class PalletMetadata : BaseType - { - /// - public override byte[] Encode() - { - throw new NotImplementedException(); - } - - /// - public override void Decode(byte[] byteArray, ref int p) - { - var start = p; - - PalletName = new Str(); - PalletName.Decode(byteArray, ref p); - - PalletStorage = new BaseOpt(); - PalletStorage.Decode(byteArray, ref p); - - PalletCalls = new BaseOpt(); - PalletCalls.Decode(byteArray, ref p); - - PalletEvents = new BaseOpt(); - PalletEvents.Decode(byteArray, ref p); - - PalletConstants = new BaseVec(); - PalletConstants.Decode(byteArray, ref p); - - PalletErrors = new BaseOpt(); - PalletErrors.Decode(byteArray, ref p); - - Index = new U8(); - Index.Decode(byteArray, ref p); - - TypeSize = p - start; - } - - /// - /// Palette Name - /// - public Str PalletName { get; private set; } - - /// - /// Palette Storage - /// - public BaseOpt PalletStorage { get; private set; } - - /// - /// Palette Calls - /// - public BaseOpt PalletCalls { get; private set; } - - /// - /// Palette Events - /// - public BaseOpt PalletEvents { get; private set; } - - /// - /// Palette Constants - /// - public BaseVec PalletConstants { get; private set; } - - /// - /// Palette Errors - /// - public BaseOpt PalletErrors { get; private set; } - - /// - /// Index - /// - public U8 Index { get; private set; } - } - - /// - /// Storage Metadata - /// - public class StorageMetadata : BaseType - { - /// - public override byte[] Encode() - { - throw new NotImplementedException(); - } - - /// - public override void Decode(byte[] byteArray, ref int p) - { - var start = p; - - Prefix = new Str(); - Prefix.Decode(byteArray, ref p); - - Entries = new BaseVec(); - Entries.Decode(byteArray, ref p); - - TypeSize = p - start; - } - - /// - /// Prefix - /// - public Str Prefix { get; private set; } - - /// - /// Entries - /// - public BaseVec Entries { get; private set; } - } - - /// - /// Storage Entry Metadata - /// - public class StorageEntryMetadata : BaseType - { - /// - public override byte[] Encode() - { - throw new NotImplementedException(); - } - - /// - public override void Decode(byte[] byteArray, ref int p) - { - var start = p; - - StorageName = new Str(); - StorageName.Decode(byteArray, ref p); - - StorageModifier = new BaseEnum(); - StorageModifier.Decode(byteArray, ref p); - - StorageType = new BaseEnumExt(); - StorageType.Decode(byteArray, ref p); - - StorageDefault = new ByteGetter(); - StorageDefault.Decode(byteArray, ref p); - - Documentation = new BaseVec(); - Documentation.Decode(byteArray, ref p); - - TypeSize = p - start; - } - - /// - /// Storage Name - /// - public Str StorageName { get; private set; } - - /// - /// Storage Modifier - /// - public BaseEnum StorageModifier { get; private set; } - - /// - /// Storage Type - /// - public BaseEnumExt StorageType { get; private set; } - - /// - /// Storage Default - /// - public ByteGetter StorageDefault { get; private set; } - - /// - /// Documentation - /// - public BaseVec Documentation { get; private set; } - } - - /// - /// Byte Getter - /// - public class ByteGetter : BaseVec - { - } - - /// - /// Storage Entry Type Map - /// - public class StorageEntryTypeMap : BaseType - { - /// - public override byte[] Encode() - { - throw new NotImplementedException(); - } - - /// - public override void Decode(byte[] byteArray, ref int p) - { - var start = p; - - Hashers = new BaseVec>(); - Hashers.Decode(byteArray, ref p); - - Key = new TType(); - Key.Decode(byteArray, ref p); - - Value = new TType(); - Value.Decode(byteArray, ref p); - - TypeSize = p - start; - } - - /// - /// Hashers - /// - public BaseVec> Hashers { get; private set; } - - /// - /// Key - /// - public TType Key { get; private set; } - - /// - /// Value - /// - public TType Value { get; private set; } - } - - /// - /// Pallet Call Metadata - /// - public class PalletCallMetadata : BaseType - { - /// - public override byte[] Encode() - { - throw new NotImplementedException(); - } - - /// - public override void Decode(byte[] byteArray, ref int p) - { - var start = p; - - CallType = new TType(); - CallType.Decode(byteArray, ref p); - - TypeSize = p - start; - } - - /// - /// Call Type - /// - public TType CallType { get; private set; } - } - - /// - /// Palette Event Metadata - /// - public class PalletEventMetadata : BaseType - { - /// - public override byte[] Encode() - { - throw new NotImplementedException(); - } - - /// - public override void Decode(byte[] byteArray, ref int p) - { - var start = p; - - EventType = new TType(); - EventType.Decode(byteArray, ref p); - - TypeSize = p - start; - } - - /// - /// Event Type - /// - public TType EventType { get; private set; } - } - - /// - /// Pallet Constant Metadata - /// - public class PalletConstantMetadata : BaseType - { - /// - /// Encode to Bytes - /// - /// - /// - public override byte[] Encode() - { - throw new NotImplementedException(); - } - - /// - /// Decode from a byte array at certain position - /// - /// - /// - public override void Decode(byte[] byteArray, ref int p) - { - var start = p; - - ConstantName = new Str(); - ConstantName.Decode(byteArray, ref p); - - ConstantType = new TType(); - ConstantType.Decode(byteArray, ref p); - - ConstantValue = new ByteGetter(); - ConstantValue.Decode(byteArray, ref p); - - Documentation = new BaseVec(); - Documentation.Decode(byteArray, ref p); - - TypeSize = p - start; - } - - /// - /// Constant Name - /// - public Str ConstantName { get; private set; } - - /// - /// Constant Type - /// - public TType ConstantType { get; private set; } - - /// - /// Constant Value - /// - public ByteGetter ConstantValue { get; private set; } - - /// - /// Documentation - /// - public BaseVec Documentation { get; private set; } - } - - /// - /// Error Metadata - /// - public class ErrorMetadata : BaseType - { - /// - public override byte[] Encode() - { - throw new NotImplementedException(); - } - - /// - public override void Decode(byte[] byteArray, ref int p) - { - var start = p; - - ErrorType = new TType(); - ErrorType.Decode(byteArray, ref p); - - TypeSize = p - start; - } - - /// - /// Error Type - /// - public TType ErrorType { get; private set; } - } - - /// - /// Extrinsic Metadata Struct - /// - public class ExtrinsicMetadataStruct : BaseType - { - /// - public override byte[] Encode() - { - throw new NotImplementedException(); - } - - /// - public override void Decode(byte[] byteArray, ref int p) - { - var start = p; - - ExtrinsicType = new TType(); - ExtrinsicType.Decode(byteArray, ref p); - - Version = new U8(); - Version.Decode(byteArray, ref p); - - SignedExtensions = new BaseVec(); - SignedExtensions.Decode(byteArray, ref p); - - TypeSize = p - start; - } - - /// - /// Extrinsic Type - /// - public TType ExtrinsicType { get; private set; } - - /// - /// Version - /// - public U8 Version { get; private set; } - - /// - /// Signed Extensions - /// - public BaseVec SignedExtensions { get; private set; } - } - - /// - /// Signed Extension Metadata Struct - /// - public class SignedExtensionMetadataStruct : BaseType - { - /// - public override byte[] Encode() - { - throw new NotImplementedException(); - } - - /// - public override void Decode(byte[] byteArray, ref int p) - { - var start = p; - - SignedIdentifier = new Str(); - SignedIdentifier.Decode(byteArray, ref p); - - SignedExtType = new TType(); - SignedExtType.Decode(byteArray, ref p); - - AddSignedExtType = new TType(); - AddSignedExtType.Decode(byteArray, ref p); - - TypeSize = p - start; - } - - /// - /// Signed Identifier - /// - public Str SignedIdentifier { get; private set; } - - /// - /// Signed Extension Type - /// - public TType SignedExtType { get; private set; } - - /// - /// Add Signed Extension Type - /// - public TType AddSignedExtType { get; private set; } - } } \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V15/CustomMetadataV15.cs b/Substrate.NetApi/Model/Types/Metadata/V15/CustomMetadataV15.cs new file mode 100644 index 0000000..67bdf36 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/V15/CustomMetadataV15.cs @@ -0,0 +1,68 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.V15 +{ + public class CustomMetadataV15 : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + Map = new BaseVec>(); + Map.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Map + /// + public BaseVec> Map { get; private set; } + } + + /// + /// Custom Value Metadata + /// + public class CustomValueMetadataV15 : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + CustomType = new TType(); + CustomType.Decode(byteArray, ref p); + + Value = new BaseVec(); + Value.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Custom Type + /// + public TType CustomType { get; private set; } + + /// + /// Value + /// + public BaseVec Value { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V15/ExtrinsicMetadataV15.cs b/Substrate.NetApi/Model/Types/Metadata/V15/ExtrinsicMetadataV15.cs new file mode 100644 index 0000000..9bfe846 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/V15/ExtrinsicMetadataV15.cs @@ -0,0 +1,79 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.Base +{ + /// + /// Extrinsic Metadata Struct + /// + public class ExtrinsicMetadataV15 : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + Version = new U8(); + Version.Decode(byteArray, ref p); + + AddressType = new TType(); + AddressType.Decode(byteArray, ref p); + + CallType = new TType(); + CallType.Decode(byteArray, ref p); + + SignatureType = new TType(); + SignatureType.Decode(byteArray, ref p); + + ExtraType = new TType(); + ExtraType.Decode(byteArray, ref p); + + SignedExtensions = new BaseVec(); + SignedExtensions.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Extrinsic Type + /// + public TType ExtrinsicType { get; private set; } + + /// + /// Version + /// + public U8 Version { get; private set; } + + /// + /// Address Type + /// + public TType AddressType { get; private set; } + + /// + /// Call Type + /// + public TType CallType { get; private set; } + + /// + /// Signature Type + /// + public TType SignatureType { get; private set; } + + /// + /// Extra Type + /// + public TType ExtraType { get; private set; } + + /// + /// Signed Extensions + /// + public BaseVec SignedExtensions { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V15/OuterEnumsV15.cs b/Substrate.NetApi/Model/Types/Metadata/V15/OuterEnumsV15.cs new file mode 100644 index 0000000..df04b16 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/V15/OuterEnumsV15.cs @@ -0,0 +1,50 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.V15 +{ + /// + /// Outer Enums + /// + public class OuterEnumsV15 : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + CallEnumTypeId = new TType(); + CallEnumTypeId.Decode(byteArray, ref p); + + EventEnumTypeId = new TType(); + EventEnumTypeId.Decode(byteArray, ref p); + + ErrorEnumTypeId = new TType(); + ErrorEnumTypeId.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Call Enum Type Id + /// + public TType CallEnumTypeId { get; private set; } + + /// + /// Event Enum Type Id + /// + public TType EventEnumTypeId { get; private set; } + + /// + /// Error Enum Type Id + /// + public TType ErrorEnumTypeId { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V15/PalletMetadataV15.cs b/Substrate.NetApi/Model/Types/Metadata/V15/PalletMetadataV15.cs new file mode 100644 index 0000000..e241994 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/V15/PalletMetadataV15.cs @@ -0,0 +1,92 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; +using Substrate.NetApi.Model.Types.Metadata.V14; +using Substrate.NetApi.Model.Types.Primitive; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.V15 +{ + /// + /// Palette Metadata + /// + public class PalletMetadataV15 : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + PalletName = new Str(); + PalletName.Decode(byteArray, ref p); + + PalletStorage = new BaseOpt(); + PalletStorage.Decode(byteArray, ref p); + + PalletCalls = new BaseOpt(); + PalletCalls.Decode(byteArray, ref p); + + PalletEvents = new BaseOpt(); + PalletEvents.Decode(byteArray, ref p); + + PalletConstants = new BaseVec(); + PalletConstants.Decode(byteArray, ref p); + + PalletErrors = new BaseOpt(); + PalletErrors.Decode(byteArray, ref p); + + Index = new U8(); + Index.Decode(byteArray, ref p); + + Docs = new BaseVec(); + Docs.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Palette Name + /// + public Str PalletName { get; private set; } + + /// + /// Palette Storage + /// + public BaseOpt PalletStorage { get; private set; } + + /// + /// Palette Calls + /// + public BaseOpt PalletCalls { get; private set; } + + /// + /// Palette Events + /// + public BaseOpt PalletEvents { get; private set; } + + /// + /// Palette Constants + /// + public BaseVec PalletConstants { get; private set; } + + /// + /// Palette Errors + /// + public BaseOpt PalletErrors { get; private set; } + + /// + /// Index + /// + public U8 Index { get; private set; } + + /// + /// Docs + /// + public BaseVec Docs { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V15/RuntimeApiMetadataV15.cs b/Substrate.NetApi/Model/Types/Metadata/V15/RuntimeApiMetadataV15.cs new file mode 100644 index 0000000..1d2e7b2 --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/V15/RuntimeApiMetadataV15.cs @@ -0,0 +1,138 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.Base +{ + /// + /// Runtime API Metadata + /// + public class RuntimeApiMetadataV15 : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + Name = new Str(); + Name.Decode(byteArray, ref p); + + Methods = new BaseVec(); + Methods.Decode(byteArray, ref p); + + Docs = new BaseVec(); + Docs.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Name + /// + public Str Name { get; private set; } + + /// + /// Methods + /// + public BaseVec Methods { get; private set; } + + /// + /// Docs + /// + public BaseVec Docs { get; private set; } + } + + /// + /// Runtime API Method Metadata + /// + public class RuntimeApiMethodMetadataV15 : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + Name = new Str(); + Name.Decode(byteArray, ref p); + + Inputs = new BaseVec(); + Inputs.Decode(byteArray, ref p); + + Output = new TType(); + Output.Decode(byteArray, ref p); + + Docs = new BaseVec(); + Docs.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Name + /// + public Str Name { get; private set; } + + /// + /// Inputs + /// + public BaseVec Inputs { get; private set; } + + /// + /// Output + /// + public TType Output { get; private set; } + + /// + /// Docs + /// + public BaseVec Docs { get; private set; } + } + + /// + /// Runtime API Method Param Metadata + /// + public class RuntimeApiMethodParamMetadataV15 : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + Name = new Str(); + Name.Decode(byteArray, ref p); + + TypeId = new TType(); + TypeId.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Name + /// + public Str Name { get; private set; } + + /// + /// Type Id + /// + public TType TypeId { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Model/Types/Metadata/V15/RuntimeMetadataV15.cs b/Substrate.NetApi/Model/Types/Metadata/V15/RuntimeMetadataV15.cs new file mode 100644 index 0000000..5b1872c --- /dev/null +++ b/Substrate.NetApi/Model/Types/Metadata/V15/RuntimeMetadataV15.cs @@ -0,0 +1,84 @@ +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Metadata.Base; +using Substrate.NetApi.Model.Types.Metadata.Base.Portable; +using Substrate.NetApi.Model.Types.Metadata.V15; +using System; + +namespace Substrate.NetApi.Model.Types.Metadata.V14 +{ + /// + /// Runtime Metadata V14 + /// + public class RuntimeMetadataV15 : BaseType + { + /// + public override byte[] Encode() + { + throw new NotImplementedException(); + } + + /// + public override void Decode(byte[] byteArray, ref int p) + { + var start = p; + + Types = new PortableRegistry(); + Types.Decode(byteArray, ref p); + + Modules = new BaseVec(); + Modules.Decode(byteArray, ref p); + + Extrinsic = new ExtrinsicMetadataV15(); + Extrinsic.Decode(byteArray, ref p); + + TypeId = new TType(); + TypeId.Decode(byteArray, ref p); + + Apis = new BaseVec(); + Apis.Decode(byteArray, ref p); + + OuterEnums = new OuterEnumsV15(); + OuterEnums.Decode(byteArray, ref p); + + Custom = new CustomMetadataV15(); + Custom.Decode(byteArray, ref p); + + TypeSize = p - start; + } + + /// + /// Types + /// + public PortableRegistry Types { get; private set; } + + /// + /// Modules + /// + public BaseVec Modules { get; private set; } + + /// + /// Extrinsic + /// + public ExtrinsicMetadataV15 Extrinsic { get; private set; } + + /// + /// Type Id + /// + public TType TypeId { get; private set; } + + /// + /// Apis + /// + public BaseVec Apis { get; private set; } + + /// + /// OuterEnums + /// + public OuterEnumsV15 OuterEnums { get; private set; } + + /// + /// Custom + /// + public CustomMetadataV15 Custom { get; private set; } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Modules/Legacy/Contracts/IRuntimeCall.cs b/Substrate.NetApi/Modules/Legacy/Contracts/IRuntimeCall.cs new file mode 100644 index 0000000..45ae5e1 --- /dev/null +++ b/Substrate.NetApi/Modules/Legacy/Contracts/IRuntimeCall.cs @@ -0,0 +1,36 @@ +using Substrate.NetApi.Model.Rpc; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; +using System.Threading; +using System.Threading.Tasks; + +namespace Substrate.NetApi.Modules.Contracts +{ + /// + /// Runtime Call Module Interface + /// + public interface IRuntimeCall + { + /// + /// Returns the metadata of a runtime. + /// + /// + /// + Task> MetadataAsync(CancellationToken token); + + /// + /// Returns the metadata at a given version. + /// + /// + /// + /// + Task>> MetadataAtVersionAsync(uint version, CancellationToken token); + + /// + /// Returns the supported metadata versions. + /// + /// + /// + Task> MetadataVersionsAsync(CancellationToken token); + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Modules/Legacy/RuntimeCall.cs b/Substrate.NetApi/Modules/Legacy/RuntimeCall.cs new file mode 100644 index 0000000..76667ce --- /dev/null +++ b/Substrate.NetApi/Modules/Legacy/RuntimeCall.cs @@ -0,0 +1,96 @@ +using Newtonsoft.Json.Linq; +using Substrate.NetApi.Model.Types.Base; +using Substrate.NetApi.Model.Types.Primitive; +using Substrate.NetApi.Modules.Contracts; +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Substrate.NetApi.Modules +{ + /// + /// RuntimeCall Module + /// + public class RuntimeCall : IRuntimeCall + { + private readonly SubstrateClient _client; + + /// + /// RuntimeCall Module Constructor + /// + /// + internal RuntimeCall(SubstrateClient client) + { + _client = client; + } + + /// + public async Task> MetadataAsync( CancellationToken token) + { + var fullParams = new object[] + { + "Metadata_metadata", + Array.Empty(), + null + }; + + var str = await _client.InvokeAsync("state_call", fullParams, token); + + if (str == null || str.Length == 0) + { + return default; + } + + var t = new BaseVec(); + t.Create(str); + + return t; + } + + /// + public async Task>> MetadataAtVersionAsync(uint version, CancellationToken token) + { + var fullParams = new object[] + { + "Metadata_metadata_at_version", + Utils.Bytes2HexString(new U32(version).Encode()), + null + }; + + var str = await _client.InvokeAsync("state_call", fullParams, token); + + if (str == null || str.Length == 0) + { + return default; + } + + var t = new BaseOpt>(); + t.Create(str); + + return t; + } + + /// + public async Task> MetadataVersionsAsync(CancellationToken token) + { + var fullParams = new object[] + { + "Metadata_metadata_versions", + Array.Empty(), + null + }; + + var str = await _client.InvokeAsync("state_call", fullParams, token); + + if (str == null || str.Length == 0) + { + return default; + } + + var t = new BaseVec(); + t.Create(str); + + return t; + } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/Substrate.NetApi.csproj b/Substrate.NetApi/Substrate.NetApi.csproj index 3b99c0a..7163616 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.22-rc + 0.9.24-rc6 Substrate Gaming Substrate Gaming true diff --git a/Substrate.NetApi/SubstrateClient.cs b/Substrate.NetApi/SubstrateClient.cs index 8cf7951..0333514 100644 --- a/Substrate.NetApi/SubstrateClient.cs +++ b/Substrate.NetApi/SubstrateClient.cs @@ -20,17 +20,20 @@ using Serilog; using StreamJsonRpc; using Newtonsoft.Json; +using Substrate.NetApi.Model.Types.Metadata.V14; [assembly: InternalsVisibleTo("Substrate.NetApi.Test")] namespace Substrate.NetApi { - /// A substrate client. - /// 19.09.2020. - /// + /// + /// Substrate client + /// public class SubstrateClient : IDisposable { - /// The logger. + /// + /// The logger. + /// private static readonly ILogger Logger = new LoggerConfiguration().CreateLogger(); private readonly ExtrinsicJsonConverter _extrinsicJsonConverter; @@ -39,16 +42,24 @@ public class SubstrateClient : IDisposable private readonly TransactionEventJsonConverter _transactionEventJsonConverter; - /// The request token sources. + /// + /// The request token sources + /// private readonly ConcurrentDictionary _requestTokenSourceDict; - /// _URI of the resource. + /// + /// _URI of the resource + /// private readonly Uri _uri; - /// The connect token source. + /// + /// The connect token source + /// private CancellationTokenSource _connectTokenSource; - /// The JSON RPC. + /// + /// The JSON RPC + /// private JsonRpc _jsonRpc; /// The socket. @@ -94,13 +105,15 @@ public SubstrateClient(Uri uri, ChargeType chargeType, bool bypassRemoteCertific Payment = new Payment(this); State = new State(this); Author = new Author(this); + RuntimeCall = new RuntimeCall(this); TransactionWatchCalls = new TransactionWatchCalls(this); _requestTokenSourceDict = new ConcurrentDictionary(); } - /// Gets or sets information describing the meta. - /// Information describing the meta. + /// + /// Gets or sets information describing the meta + /// public MetaData MetaData { get; private set; } /// @@ -113,30 +126,38 @@ public SubstrateClient(Uri uri, ChargeType chargeType, bool bypassRemoteCertific /// public Properties Properties { get; private set; } - /// Gets or sets the genesis hash. - /// The genesis hash. + /// + /// Gets or sets the genesis hash + /// public Hash GenesisHash { get; private set; } - /// Gets the system. - /// The system. + /// + /// Gets the system. + /// public Modules.System System { get; } - /// Gets the chain. - /// The chain. + /// + /// Gets the chain. + /// public Chain Chain { get; } - /// Gets the payment. - /// The payment. + /// + /// Gets the payment. + /// public Payment Payment { get; } - /// Gets the state. - /// The state. + /// + /// Gets the state. + /// public State State { get; } - /// Gets the author. - /// The author. + /// + /// Gets the author. + /// public Author Author { get; } + public RuntimeCall RuntimeCall { get; } + /// /// New Api 2 /// @@ -147,10 +168,21 @@ public SubstrateClient(Uri uri, ChargeType chargeType, bool bypassRemoteCertific /// public SubscriptionListener Listener { get; } = new SubscriptionListener(); - /// Gets a value indicating whether this object is connected. - /// True if this object is connected, false if not. + /// + /// Gets a value indicating whether this object is connected. + /// public bool IsConnected => _socket?.State == WebSocketState.Open && _jsonRpc != null; + /// + /// Maximum number of retry attempts to connect to the node. + /// + private int _maxRetryAttempts; + + /// + /// Delay in milliseconds before retrying to connect to the node. + /// + private int _delayRetryMilliseconds; + /// /// Sets the JSON-RPC logging level. /// @@ -176,7 +208,7 @@ public async Task ConnectAsync() } /// - /// Asynchronously connects to the node. + /// Connect to the node asynchronously. /// /// Cancellation token. /// @@ -186,7 +218,7 @@ public async Task ConnectAsync(CancellationToken token) } /// - /// Asynchronously connects to the node. + /// Connect to the node asynchronously. /// /// Parse metadata on connect. /// Cancellation token. @@ -197,21 +229,41 @@ public async Task ConnectAsync(bool useMetaData, CancellationToken token) } /// - /// Asynchronously connects to the node. + /// Connect to the node asynchronously. /// - /// Parse metadata on connect. - /// Get blocknumber and runtime information from standard susbtrate node. - /// Cancellation token. + /// + /// + /// /// public async Task ConnectAsync(bool useMetaData, bool standardSubstrate, CancellationToken token) { + await ConnectAsync(useMetaData, standardSubstrate, 5, 2000, token); + } + + /// + /// Connect to the node asynchronously. + /// + /// + /// + /// + /// + /// + /// + public async Task ConnectAsync(bool useMetaData, bool standardSubstrate, int maxRetryAttempts, int delayRetryMilliseconds, CancellationToken token) + { + _maxRetryAttempts = maxRetryAttempts; + _delayRetryMilliseconds = delayRetryMilliseconds; + if (_socket != null && _socket.State == WebSocketState.Open) + { return; + } if (_socket == null || _socket.State != WebSocketState.None) { _jsonRpc?.Dispose(); _socket?.Dispose(); + _socket = new ClientWebSocket(); // Set RemoteCertificateValidationCallback to return true @@ -220,7 +272,7 @@ public async Task ConnectAsync(bool useMetaData, bool standardSubstrate, Cancell #if NETSTANDARD2_0 throw new NotSupportedException("Bypass remote certification validation not supported in NETStandard2.0"); #elif NETSTANDARD2_1_OR_GREATER - _socket.Options.RemoteCertificateValidationCallback = (sender, certificate, chain, errors) => true; + _socket.Options.RemoteCertificateValidationCallback = (sender, certificate, chain, errors) => true; #endif } } @@ -251,24 +303,19 @@ public async Task ConnectAsync(bool useMetaData, bool standardSubstrate, Cancell formatter.JsonSerializer.Converters.Add(_transactionEventJsonConverter); _jsonRpc = new JsonRpc(new WebSocketMessageHandler(_socket, formatter)); + _jsonRpc.Disconnected += OnJsonRpcDisconnected; _jsonRpc.TraceSource.Listeners.Add(new SerilogTraceListener.SerilogTraceListener()); _jsonRpc.TraceSource.Switch.Level = SourceLevels.Warning; - - _jsonRpc.Disconnected += (sender, args) => - { - Logger.Debug("Disconnected from websocket."); - OnConnectionLost(); - }; - _jsonRpc.AddLocalRpcTarget(Listener, new JsonRpcTargetOptions { AllowNonPublicInvocation = false }); _jsonRpc.StartListening(); + Logger.Debug("Listening to websocket."); if (useMetaData) { var result = await State.GetMetaDataAsync(token); - var mdv14 = new RuntimeMetadata(); + var mdv14 = new RuntimeMetadata(); mdv14.Create(result); MetaData = new MetaData(mdv14, _uri.OriginalString); Logger.Debug("MetaData parsed."); @@ -296,21 +343,66 @@ public async Task ConnectAsync(bool useMetaData, bool standardSubstrate, Cancell Logger.Warning(ex, "Could not deserialize properties on connect."); } } + + //_jsonRpc.TraceSource.Switch.Level = SourceLevels.All; } - /// - /// Raises the event when the connection to the server is lost. - /// - protected virtual void OnConnectionLost() { - ConnectionLost?.Invoke(this, EventArgs.Empty); + private void OnJsonRpcDisconnected(object sender, JsonRpcDisconnectedEventArgs e) + { + Logger.Error(e.Exception, $"JsonRpc disconnected: {e.Reason}"); + + // Attempt to reconnect asynchronously + _ = Task.Run(async () => + { + Console.WriteLine("JsonRpc disconnected attempting to reconnect..."); + await ReconnectAsync(); + }); } - /// - /// Raises the event when the connection to the server is set. - /// - protected virtual void OnConnectionSet() + private readonly SemaphoreSlim _reconnectSemaphore = new SemaphoreSlim(1, 1); + + private async Task ReconnectAsync() { - ConnectionSet?.Invoke(this, EventArgs.Empty); + if (!await _reconnectSemaphore.WaitAsync(0)) + { + // Another reconnection attempt is already in progress + return; + } + + for (int retry = 1; retry <= _maxRetryAttempts; retry++) + { + try + { + Logger.Information("Attempting to reconnect..."); + + // You may need to store the parameters used during the initial connection + await ConnectAsync( + useMetaData: true, + standardSubstrate: true, + maxRetryAttempts: _maxRetryAttempts, + delayRetryMilliseconds: _delayRetryMilliseconds, + token: CancellationToken.None + ); + + Logger.Information("Reconnected successfully."); + } + catch (Exception ex) + { + Logger.Warning(ex, $"Reconnection attempt {retry} failed."); + if (retry == _maxRetryAttempts) + { + Logger.Error("Max reconnection attempts reached. Unable to reconnect."); + throw; + } + + await Task.Delay(_delayRetryMilliseconds * retry, CancellationToken.None); + } + finally + { + _reconnectSemaphore.Release(); + + } + } } /// @@ -524,10 +616,19 @@ protected virtual void Dispose(bool disposing) _connectTokenSource?.Dispose(); // dispose remaining request tokens - foreach (var key in _requestTokenSourceDict.Keys) key?.Dispose(); + foreach (var key in _requestTokenSourceDict.Keys) + { + key?.Dispose(); + } + _requestTokenSourceDict.Clear(); - _jsonRpc?.Dispose(); + if (_jsonRpc != null) + { + _jsonRpc.Disconnected -= OnJsonRpcDisconnected; + _jsonRpc.Dispose(); + } + _socket?.Dispose(); Logger.Debug("Client disposed."); } @@ -546,4 +647,4 @@ public void Dispose() #endregion IDisposable Support } -} \ No newline at end of file +} diff --git a/Substrate.NetApi/TypeConverters/BigIntegerConverter .cs b/Substrate.NetApi/TypeConverters/BigIntegerConverter .cs new file mode 100644 index 0000000..8543b10 --- /dev/null +++ b/Substrate.NetApi/TypeConverters/BigIntegerConverter .cs @@ -0,0 +1,38 @@ +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Numerics; + +namespace Substrate.Integration.Helper +{ + + /// + /// BigIntegerConverter + /// + public class BigIntegerConverter : JsonConverter + { + /// + /// Read + /// + /// + /// + /// + /// + public override BigInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var stringValue = reader.GetString(); + return BigInteger.Parse(stringValue); + } + + /// + /// Write + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BigInteger value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString()); + } + } +} \ No newline at end of file diff --git a/Substrate.NetApi/TypeConverters/ExtrinsicStatusJsonConverter.cs b/Substrate.NetApi/TypeConverters/ExtrinsicStatusJsonConverter.cs index 501aea4..cef2c61 100644 --- a/Substrate.NetApi/TypeConverters/ExtrinsicStatusJsonConverter.cs +++ b/Substrate.NetApi/TypeConverters/ExtrinsicStatusJsonConverter.cs @@ -43,18 +43,15 @@ public override TransactionEventInfo ReadJson(JsonReader reader, Type objectType case TransactionEvent.Validated: break; - case TransactionEvent.Broadcasted: - transactionEventStatus.NumPeers = uint.Parse(jObject["numPeers"].ToString()); - break; - case TransactionEvent.BestChainBlockIncluded: case TransactionEvent.Finalized: transactionEventStatus.Hash = null; transactionEventStatus.Index = null; - if (jObject["block"] != null) + var block = jObject["block"]; + if (block != null && block.Type == JTokenType.Object) { - transactionEventStatus.Hash = new Hash(jObject["block"]["hash"].ToString()); - transactionEventStatus.Index = uint.Parse(jObject["block"]["index"].ToString()); + transactionEventStatus.Hash = new Hash(block["hash"]?.ToString()); + transactionEventStatus.Index = uint.Parse(block["index"]?.ToString()); } break;