Ejemplo n.º 1
0
        public static XRYOCOutBlock FromQuery(XRYOC query)
        {
            XRYOCOutBlock block = new XRYOCOutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            try
            {
                block.ychetime   = query.GetFieldData(block.GetBlockName(), "ychetime").TrimEnd('?');               // char 6
                block.yeprice    = query.GetFieldData(block.GetBlockName(), "yeprice").ParseFloat("yeprice");       // float 6.2
                block.jnilysign  = query.GetFieldData(block.GetBlockName(), "jnilysign").FirstOrDefault();          // char 1
                block.preychange = query.GetFieldData(block.GetBlockName(), "preychange").ParseFloat("preychange"); // float 6.2
                block.jnilydrate = query.GetFieldData(block.GetBlockName(), "jnilydrate").ParseFloat("jnilydrate"); // float 6.2
                block.optcode    = query.GetFieldData(block.GetBlockName(), "optcode").TrimEnd('?');                // char 8
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Ejemplo n.º 2
0
        public XRYOCOutBlock GetBlock()
        {
            XRYOCOutBlock instance = XRYOCOutBlock.FromQuery(this);

            return(instance);
        }