Beispiel #1
0
        void IPinchable.Encode(IPinchEncoder encoder)
        {
            encoder.EncodeChoiceMarker((int)_valueKind);

            switch (_valueKind)
            {
                case ChoiceStructureKind.None:
                    throw new PinchNullRequiredFieldException();

                case ChoiceStructureKind.Small:
                    encoder.EncodeRequiredStructure((IPinchable)_value, _smallProperties);
                    break;

                case ChoiceStructureKind.RequiredDecimal:
                    encoder.EncodeRequiredStructure((IPinchable)_value, _requiredDecimalProperties);
                    break;

                case ChoiceStructureKind.OptionalDecimal:
                    encoder.EncodeRequiredStructure((IPinchable)_value, _optionalDecimalProperties);
                    break;

                case ChoiceStructureKind.Versioning:
                    encoder.EncodeRequiredStructure((IPinchable)_value, _versioningProperties);
                    break;

            }
        }