public static XRKH_OutBlock FromQuery(XRKH_ query) { XRKH_OutBlock block = new XRKH_OutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.time = query.GetFieldData(block.GetBlockName(), "time").TrimEnd('?'); // char 6 block.price = query.GetFieldData(block.GetBlockName(), "price").ParseLong("price"); // long 8 block.sign = query.GetFieldData(block.GetBlockName(), "sign").ParseLong("sign"); // long 1 block.change = query.GetFieldData(block.GetBlockName(), "change").ParseLong("change"); // long 8 block.volume = query.GetFieldData(block.GetBlockName(), "volume").ParseLong("volume"); // long 10 block.drate = query.GetFieldData(block.GetBlockName(), "drate").ParseFloat("drate"); // float 6.2 block.cdhrem = query.GetFieldData(block.GetBlockName(), "cdhrem").ParseLong("cdhrem"); // long 9 block.cshrem = query.GetFieldData(block.GetBlockName(), "cshrem").ParseLong("cshrem"); // long 9 block.bdhrem = query.GetFieldData(block.GetBlockName(), "bdhrem").ParseLong("bdhrem"); // long 9 block.bshrem = query.GetFieldData(block.GetBlockName(), "bshrem").ParseLong("bshrem"); // long 9 block.cdhvolume = query.GetFieldData(block.GetBlockName(), "cdhvolume").ParseLong("cdhvolume"); // long 9 block.cshvolume = query.GetFieldData(block.GetBlockName(), "cshvolume").ParseLong("cshvolume"); // long 9 block.bdhvolume = query.GetFieldData(block.GetBlockName(), "bdhvolume").ParseLong("bdhvolume"); // long 9 block.bshvolume = query.GetFieldData(block.GetBlockName(), "bshvolume").ParseLong("bshvolume"); // long 9 block.dwcvolume = query.GetFieldData(block.GetBlockName(), "dwcvolume").ParseLong("dwcvolume"); // long 9 block.swcvolume = query.GetFieldData(block.GetBlockName(), "swcvolume").ParseLong("swcvolume"); // long 9 block.djcvolume = query.GetFieldData(block.GetBlockName(), "djcvolume").ParseLong("djcvolume"); // long 9 block.sjcvolume = query.GetFieldData(block.GetBlockName(), "sjcvolume").ParseLong("sjcvolume"); // long 9 block.tdvolume = query.GetFieldData(block.GetBlockName(), "tdvolume").ParseLong("tdvolume"); // long 9 block.tsvolume = query.GetFieldData(block.GetBlockName(), "tsvolume").ParseLong("tsvolume"); // long 9 block.tvol = query.GetFieldData(block.GetBlockName(), "tvol").ParseLong("tvol"); // long 9 block.dwcvalue = query.GetFieldData(block.GetBlockName(), "dwcvalue").ParseLong("dwcvalue"); // long 12 block.swcvalue = query.GetFieldData(block.GetBlockName(), "swcvalue").ParseLong("swcvalue"); // long 12 block.djcvalue = query.GetFieldData(block.GetBlockName(), "djcvalue").ParseLong("djcvalue"); // long 12 block.sjcvalue = query.GetFieldData(block.GetBlockName(), "sjcvalue").ParseLong("sjcvalue"); // long 12 block.tdvalue = query.GetFieldData(block.GetBlockName(), "tdvalue").ParseLong("tdvalue"); // long 12 block.tsvalue = query.GetFieldData(block.GetBlockName(), "tsvalue").ParseLong("tsvalue"); // long 12 block.tval = query.GetFieldData(block.GetBlockName(), "tval").ParseLong("tval"); // long 12 block.pdgvolume = query.GetFieldData(block.GetBlockName(), "pdgvolume").ParseLong("pdgvolume"); // long 9 block.psgvolume = query.GetFieldData(block.GetBlockName(), "psgvolume").ParseLong("psgvolume"); // long 9 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 XRKH_OutBlock GetBlock() { XRKH_OutBlock instance = XRKH_OutBlock.FromQuery(this); return(instance); }