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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1954OutBlock1 block = new XQt1954OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.date     = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?');                 // char 8
                    block.open     = query.GetFieldData(block.GetBlockName(), "open", i).ParseLong("open");            // long 8
                    block.high     = query.GetFieldData(block.GetBlockName(), "high", i).ParseLong("high");            // long 8
                    block.low      = query.GetFieldData(block.GetBlockName(), "low", i).ParseLong("low");              // long 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).ParseFloat("volume");       // float 12
                    block.bsprice  = query.GetFieldData(block.GetBlockName(), "bsprice", i).ParseLong("bsprice");      // long 8
                    block.bjprice  = query.GetFieldData(block.GetBlockName(), "bjprice", i).ParseFloat("bjprice");     // float 8.2
                    block.bsign    = query.GetFieldData(block.GetBlockName(), "bsign", i).FirstOrDefault();            // char 1
                    block.bschange = query.GetFieldData(block.GetBlockName(), "bschange", i).ParseLong("bschange");    // long 8
                    block.bjchange = query.GetFieldData(block.GetBlockName(), "bjchange", i).ParseFloat("bjchange");   // float 8.2
                    block.bdiff    = query.GetFieldData(block.GetBlockName(), "bdiff", i).ParseFloat("bdiff");         // float 6.2
                    block.bvolume  = query.GetFieldData(block.GetBlockName(), "bvolume", i).ParseFloat("bvolume");     // float 12
                    block.parity   = query.GetFieldData(block.GetBlockName(), "parity", i).ParseFloat("parity");       // float 6.2
                    block.egearing = query.GetFieldData(block.GetBlockName(), "egearing", i).ParseFloat("egearing");   // float 6.2
                    block.premium  = query.GetFieldData(block.GetBlockName(), "premium", i).ParseFloat("premium");     // float 6.2
                    block.berate   = query.GetFieldData(block.GetBlockName(), "berate", i).ParseFloat("berate");       // float 6.2
                    block.capt     = query.GetFieldData(block.GetBlockName(), "capt", i).ParseFloat("capt");           // float 6.2
                    block.gearing  = query.GetFieldData(block.GetBlockName(), "gearing", i).ParseFloat("gearing");     // float 6.2
                    block.mness    = query.GetFieldData(block.GetBlockName(), "mness", i).FirstOrDefault();            // char 1
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
示例#2
0
文件: t1954.cs 项目: tdoobw/XingAPI
 public XQt1954OutBlock1[] GetBlock1s()
 {
     XQt1954OutBlock1[] instance = XQt1954OutBlock1.ListFromQuery(this);
     return(instance);
 }