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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt2405OutBlock1 block = new XQt2405OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.time       = query.GetFieldData(block.GetBlockName(), "time", i).TrimEnd('?');                  // char 6
                    block.price      = query.GetFieldData(block.GetBlockName(), "price", i).ParseFloat("price");          // float 6.2
                    block.sign       = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault();              // char 1
                    block.change     = query.GetFieldData(block.GetBlockName(), "change", i).ParseFloat("change");        // float 6.2
                    block.volume     = query.GetFieldData(block.GetBlockName(), "volume", i).ParseDouble("volume");       // double 12.0
                    block.cvolume    = query.GetFieldData(block.GetBlockName(), "cvolume", i).ParseLong("cvolume");       // long 8
                    block.offerho1   = query.GetFieldData(block.GetBlockName(), "offerho1", i).ParseFloat("offerho1");    // float 6.2
                    block.bidho1     = query.GetFieldData(block.GetBlockName(), "bidho1", i).ParseFloat("bidho1");        // float 6.2
                    block.offerrem   = query.GetFieldData(block.GetBlockName(), "offerrem", i).ParseLong("offerrem");     // long 8
                    block.bidrem     = query.GetFieldData(block.GetBlockName(), "bidrem", i).ParseLong("bidrem");         // long 8
                    block.offercnt   = query.GetFieldData(block.GetBlockName(), "offercnt", i).ParseLong("offercnt");     // long 8
                    block.bidcnt     = query.GetFieldData(block.GetBlockName(), "bidcnt", i).ParseLong("bidcnt");         // long 8
                    block.c_offerrem = query.GetFieldData(block.GetBlockName(), "c_offerrem", i).ParseLong("c_offerrem"); // long 8
                    block.c_bidrem   = query.GetFieldData(block.GetBlockName(), "c_bidrem", i).ParseLong("c_bidrem");     // long 8
                    block.c_offercnt = query.GetFieldData(block.GetBlockName(), "c_offercnt", i).ParseLong("c_offercnt"); // long 8
                    block.c_bidcnt   = query.GetFieldData(block.GetBlockName(), "c_bidcnt", i).ParseLong("c_bidcnt");     // long 8
                    block.r_bidrem   = query.GetFieldData(block.GetBlockName(), "r_bidrem", i).ParseFloat("r_bidrem");    // float 6.2
                    block.r_bidcnt   = query.GetFieldData(block.GetBlockName(), "r_bidcnt", i).ParseFloat("r_bidcnt");    // float 6.2
                    block.r_sign     = query.GetFieldData(block.GetBlockName(), "r_sign", i).FirstOrDefault();            // char 1
                    block.date       = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?');                  // date 8
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Exemple #2
0
 public XQt2405OutBlock1[] GetBlock1s()
 {
     XQt2405OutBlock1[] instance = XQt2405OutBlock1.ListFromQuery(this);
     return(instance);
 }