Beispiel #1
0
        public static XQt1638OutBlock[] ListFromQuery(XQt1638 query)
        {
            int count = query.GetBlockCount(XQt1638OutBlock.BlockName);
            List <XQt1638OutBlock> list = new List <XQt1638OutBlock>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1638OutBlock block = new XQt1638OutBlock();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.rank      = query.GetFieldData(block.GetBlockName(), "rank", i).ParseLong("rank");             // long 4
                    block.hname     = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?');                 // char 20
                    block.price     = query.GetFieldData(block.GetBlockName(), "price", i).ParseLong("price");           // 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.sigatotrt = query.GetFieldData(block.GetBlockName(), "sigatotrt", i).ParseFloat("sigatotrt");  // float 6.2
                    block.obuyvol   = query.GetFieldData(block.GetBlockName(), "obuyvol", i).ParseLong("obuyvol");       // long 12
                    block.buyrem    = query.GetFieldData(block.GetBlockName(), "buyrem", i).ParseLong("buyrem");         // long 12
                    block.psgvolume = query.GetFieldData(block.GetBlockName(), "psgvolume", i).ParseLong("psgvolume");   // long 12
                    block.sellrem   = query.GetFieldData(block.GetBlockName(), "sellrem", i).ParseLong("sellrem");       // long 12
                    block.pdgvolume = query.GetFieldData(block.GetBlockName(), "pdgvolume", i).ParseLong("pdgvolume");   // long 12
                    block.sigatot   = query.GetFieldData(block.GetBlockName(), "sigatot", i).ParseLong("sigatot");       // long 20
                    block.shcode    = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?');                // char 6
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Beispiel #2
0
 public XQt1638OutBlock[] GetBlocks()
 {
     XQt1638OutBlock[] instance = XQt1638OutBlock.ListFromQuery(this);
     return(instance);
 }