Ejemplo n.º 1
0
        /// <summary>
        /// Sets value to the buffer
        /// </summary>
        /// <param name="Buffer"></param>
        public void GetBuffer(byte[] Buffer)
        {
            NumberUnion nu = new NumberUnion();

            switch (Type)
            {
            case LDF_Constant.Int16:
                this.Value = BufferConverter.GetBytesInt16_BE(Buffer, nu, Location).ToString();
                break;

            case LDF_Constant.UInt16:
                this.Value = BufferConverter.GetBytesUInt16_BE(Buffer, nu, Location).ToString();
                break;

            case LDF_Constant.Int32:
                this.Value = BufferConverter.GetBytesInt32_BE(Buffer, nu, Location).ToString();
                break;

            case LDF_Constant.Float32:
                this.Value = BufferConverter.GetBytesFloat_BE(Buffer, nu, Location).ToString();
                break;

            case LDF_Constant.String:
                this.Value = BufferConverter.GetBytesString(Buffer, nu, Length, Location);
                break;

            default: break;
            }
        }