示例#1
0
文件: t2832.cs 项目: tdoobw/XingAPI
        public static XQt2832OutBlock1[] ListFromQuery(XQt2832 query)
        {
            int count = query.GetBlockCount(XQt2832OutBlock1.BlockName);
            List <XQt2832OutBlock1> list = new List <XQt2832OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt2832OutBlock1 block = new XQt2832OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.chetime    = query.GetFieldData(block.GetBlockName(), "chetime", i).TrimEnd('?');                 // char 10
                    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.cvolume    = query.GetFieldData(block.GetBlockName(), "cvolume", i).ParseLong("cvolume");         // long 8
                    block.chdegree   = query.GetFieldData(block.GetBlockName(), "chdegree", i).ParseFloat("chdegree");      // float 8.2
                    block.offerho    = query.GetFieldData(block.GetBlockName(), "offerho", i).ParseFloat("offerho");        // float 6.2
                    block.bidho      = query.GetFieldData(block.GetBlockName(), "bidho", i).ParseFloat("bidho");            // float 6.2
                    block.volume     = query.GetFieldData(block.GetBlockName(), "volume", i).ParseDouble("volume");         // double 12.0
                    block.n_msvolume = query.GetFieldData(block.GetBlockName(), "n_msvolume", i).ParseDouble("n_msvolume"); // double 12.0
                    block.n_mdvolume = query.GetFieldData(block.GetBlockName(), "n_mdvolume", i).ParseDouble("n_mdvolume"); // double 12.0
                    block.s_msvolume = query.GetFieldData(block.GetBlockName(), "s_msvolume", i).ParseDouble("s_msvolume"); // double 12.0
                    block.n_mschecnt = query.GetFieldData(block.GetBlockName(), "n_mschecnt", i).ParseLong("n_mschecnt");   // long 8
                    block.n_mdchecnt = query.GetFieldData(block.GetBlockName(), "n_mdchecnt", i).ParseLong("n_mdchecnt");   // long 8
                    block.s_mschecnt = query.GetFieldData(block.GetBlockName(), "s_mschecnt", i).ParseLong("s_mschecnt");   // long 8
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
示例#2
0
文件: t2832.cs 项目: tdoobw/XingAPI
 public XQt2832OutBlock1[] GetBlock1s()
 {
     XQt2832OutBlock1[] instance = XQt2832OutBlock1.ListFromQuery(this);
     return(instance);
 }