public static XRYK3OutBlock FromQuery(XRYK3 query) { XRYK3OutBlock block = new XRYK3OutBlock(); 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); }
public XRYK3OutBlock GetBlock() { XRYK3OutBlock instance = XRYK3OutBlock.FromQuery(this); return(instance); }