Пример #1
0
        public void Serialize(Microsoft.Cci.BinaryWriter to)
        {
            switch (this.Discriminator)
            {
            case ConstantValueTypeDiscriminator.Boolean:
                to.WriteBool(this.BooleanValue);
                break;

            case ConstantValueTypeDiscriminator.SByte:
                to.WriteSbyte(this.SByteValue);
                break;

            case ConstantValueTypeDiscriminator.Byte:
                to.WriteByte(this.ByteValue);
                break;

            case ConstantValueTypeDiscriminator.Char:
            case ConstantValueTypeDiscriminator.Int16:
                to.WriteShort(this.Int16Value);
                break;

            case ConstantValueTypeDiscriminator.UInt16:
                to.WriteUshort(this.UInt16Value);
                break;

            case ConstantValueTypeDiscriminator.Single:
                to.WriteFloat(this.SingleValue);
                break;

            case ConstantValueTypeDiscriminator.Int32:
                to.WriteInt(this.Int32Value);
                break;

            case ConstantValueTypeDiscriminator.UInt32:
                to.WriteUint(this.UInt32Value);
                break;

            case ConstantValueTypeDiscriminator.Double:
                to.WriteDouble(this.DoubleValue);
                break;

            case ConstantValueTypeDiscriminator.Int64:
                to.WriteLong(this.Int64Value);
                break;

            case ConstantValueTypeDiscriminator.UInt64:
                to.WriteUlong(this.UInt64Value);
                break;

            default: throw ExceptionUtilities.UnexpectedValue(this.Discriminator);
            }
        }
Пример #2
0
 public void PutInt64(long l)
 {
     writer.WriteLong(l);
 }