public static XQt1701OutBlock[] ListFromQuery(XQt1701 query) { int count = query.GetBlockCount(XQt1701OutBlock.BlockName); List <XQt1701OutBlock> list = new List <XQt1701OutBlock>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1701OutBlock block = new XQt1701OutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.date = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?'); // char 8 block.close = query.GetFieldData(block.GetBlockName(), "close", i).ParseLong("close"); // long 8 block.sign = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault(); // char 1 block.change = query.GetFieldData(block.GetBlockName(), "change", i).ParseLong("change"); // long 8 block.diff = query.GetFieldData(block.GetBlockName(), "diff", i).ParseFloat("diff"); // float 6.2 block.volume = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume"); // long 12 block.psnvolume = query.GetFieldData(block.GetBlockName(), "psnvolume", i).ParseLong("psnvolume"); // long 12 block.orgvolume = query.GetFieldData(block.GetBlockName(), "orgvolume", i).ParseLong("orgvolume"); // long 12 block.frgvolume = query.GetFieldData(block.GetBlockName(), "frgvolume", i).ParseLong("frgvolume"); // long 12 block.frgvolumesum = query.GetFieldData(block.GetBlockName(), "frgvolumesum", i).ParseLong("frgvolumesum"); // long 12 block.pgmvolume = query.GetFieldData(block.GetBlockName(), "pgmvolume", i).ParseLong("pgmvolume"); // long 12 block.listing = query.GetFieldData(block.GetBlockName(), "listing", i).ParseLong("listing"); // long 12 block.listupdn = query.GetFieldData(block.GetBlockName(), "listupdn", i).ParseLong("listupdn"); // long 12 block.sjrate = query.GetFieldData(block.GetBlockName(), "sjrate", i).ParseFloat("sjrate"); // float 6.2 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public XQt1701OutBlock[] GetBlocks() { XQt1701OutBlock[] instance = XQt1701OutBlock.ListFromQuery(this); return(instance); }