/// <summary> /// /// </summary> /// <param name="bytes"></param> /// <returns></returns> public override object ConvertToObject(byte[] bytes) { if (this.InnerBytesConverter == null) { throw new InvalidOperationException("InnerConverter is null"); } object r = this.InnerBytesConverter.ConvertToObject(bytes); double dblValue = Convert.ToDouble(r); return(SyntaxSemantemeValueConverter.ToSemantemeValue(dblValue, this.SyntaxSemantemeValueRate)); }
/// <summary> /// /// </summary> /// <param name="obj"></param> /// <returns></returns> public override byte[] ConvertToBytes(object obj) { if (this.InnerBytesConverter == null) { throw new InvalidOperationException("InnerConverter is null"); } double dblObj = Convert.ToDouble(obj); double dblSyntax = SyntaxSemantemeValueConverter.ToSyntaxValue(dblObj, this.SyntaxSemantemeValueRate); return(InnerBytesConverter.ConvertToBytes(dblSyntax)); }