Exemplo n.º 1
0
        void IPinchable.Encode(IPinchEncoder encoder)
        {
            encoder.OpenSequence(9);

            // Encode fields for version 1:
            encoder.EncodeOptionalString(_optPointer, _optPointerProperties);
            encoder.EncodeOptionalInt8(_optScalar, _optScalarProperties);
            encoder.EncodeOptionalStructure(_optStructure, _optStructureProperties);
            encoder.EncodeOptionalString(_removedOptPointer, _removedOptPointerProperties);
            encoder.EncodeOptionalInt8(_removedOptScalar, _removedOptScalarProperties);
            encoder.EncodeOptionalStructure(_removedOptStructure, _removedOptStructureProperties);
            encoder.EncodeRequiredString(_reqPointer, _reqPointerProperties);
            encoder.EncodeRequiredInt8(_reqScalar, _reqScalarProperties);
            encoder.EncodeRequiredStructure(_reqStructure, _reqStructureProperties);

            encoder.CloseSequence();
        }
Exemplo n.º 2
0
        void IPinchable.Encode(IPinchEncoder encoder)
        {
            encoder.OpenSequence(26);

            // Encode fields for version 1:
            encoder.EncodeOptionalBool(_optBool, _optBoolProperties);
            encoder.EncodeOptionalBytes(_optBytes, _optBytesProperties);
            encoder.EncodeOptionalDecimal(_optDecimal, _optDecimalProperties);
            encoder.EncodeOptionalEnumeration(_optEnumeration, _optEnumerationProperties);
            encoder.EncodeOptionalFloat32(_optFloat32, _optFloat32Properties);
            encoder.EncodeOptionalFloat64(_optFloat64, _optFloat64Properties);
            encoder.EncodeOptionalInt16(_optInt16, _optInt16Properties);
            encoder.EncodeOptionalInt32(_optInt32, _optInt32Properties);
            encoder.EncodeOptionalInt64(_optInt64, _optInt64Properties);
            encoder.EncodeOptionalInt8(_optInt8, _optInt8Properties);

            encoder.OpenSequence(_optListOfEnum.Count);

            foreach (SmallStructure value in _optListOfEnum)
            {
                encoder.EncodeOptionalStructure(value, _optListOfEnumProperties);
            }

            encoder.CloseSequence();

            encoder.EncodeOptionalString(_optString, _optStringProperties);
            encoder.EncodeOptionalStructure(_optStructure, _optStructureProperties);
            encoder.EncodeRequiredBool(_reqBool, _reqBoolProperties);
            encoder.EncodeRequiredBytes(_reqBytes, _reqBytesProperties);
            encoder.EncodeRequiredDecimal(_reqDecimal, _reqDecimalProperties);
            encoder.EncodeRequiredEnumeration(_reqEnumeration, _reqEnumerationProperties);
            encoder.EncodeRequiredFloat32(_reqFloat32, _reqFloat32Properties);
            encoder.EncodeRequiredFloat64(_reqFloat64, _reqFloat64Properties);
            encoder.EncodeRequiredInt16(_reqInt16, _reqInt16Properties);
            encoder.EncodeRequiredInt32(_reqInt32, _reqInt32Properties);
            encoder.EncodeRequiredInt64(_reqInt64, _reqInt64Properties);
            encoder.EncodeRequiredInt8(_reqInt8, _reqInt8Properties);

            encoder.OpenSequence(_reqListOfEnum.Count);

            foreach (SmallStructure value in _reqListOfEnum)
            {
                encoder.EncodeRequiredStructure(value, _reqListOfEnumProperties);
            }

            encoder.CloseSequence();

            encoder.EncodeRequiredString(_reqString, _reqStringProperties);
            encoder.EncodeRequiredStructure(_reqStructure, _reqStructureProperties);

            encoder.CloseSequence();
        }