Beispiel #1
0
        public static XRYs3OutBlock FromQuery(XRYs3 query)
        {
            XRYs3OutBlock block = new XRYs3OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            try
            {
                block.hotime     = query.GetFieldData(block.GetBlockName(), "hotime").TrimEnd('?');                 // char 6
                block.yeprice    = query.GetFieldData(block.GetBlockName(), "yeprice").ParseLong("yeprice");        // long 8
                block.yevolume   = query.GetFieldData(block.GetBlockName(), "yevolume").ParseLong("yevolume");      // long 12
                block.jnilysign  = query.GetFieldData(block.GetBlockName(), "jnilysign").FirstOrDefault();          // char 1
                block.preychange = query.GetFieldData(block.GetBlockName(), "preychange").ParseLong("preychange");  // long 8
                block.jnilydrate = query.GetFieldData(block.GetBlockName(), "jnilydrate").ParseFloat("jnilydrate"); // float 6.2
                block.yofferho0  = query.GetFieldData(block.GetBlockName(), "yofferho0").ParseLong("yofferho0");    // long 8
                block.ybidho0    = query.GetFieldData(block.GetBlockName(), "ybidho0").ParseLong("ybidho0");        // long 8
                block.yofferrem0 = query.GetFieldData(block.GetBlockName(), "yofferrem0").ParseLong("yofferrem0");  // long 12
                block.ybidrem0   = query.GetFieldData(block.GetBlockName(), "ybidrem0").ParseLong("ybidrem0");      // long 12
                block.shcode     = query.GetFieldData(block.GetBlockName(), "shcode").TrimEnd('?');                 // char 6
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Beispiel #2
0
        public XRYs3OutBlock GetBlock()
        {
            XRYs3OutBlock instance = XRYs3OutBlock.FromQuery(this);

            return(instance);
        }