コード例 #1
0
ファイル: t1516.cs プロジェクト: tdoobw/XingAPI
        public static XQt1516OutBlock1[] ListFromQuery(XQt1516 query)
        {
            int count = query.GetBlockCount(XQt1516OutBlock1.BlockName);
            List <XQt1516OutBlock1> list = new List <XQt1516OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1516OutBlock1 block = new XQt1516OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    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.volume     = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume");         // long 12
                    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.sojinrate  = query.GetFieldData(block.GetBlockName(), "sojinrate", i).ParseFloat("sojinrate");  // float 6.2
                    block.beta       = query.GetFieldData(block.GetBlockName(), "beta", i).ParseFloat("beta");            // float 6.5
                    block.perx       = query.GetFieldData(block.GetBlockName(), "perx", i).ParseFloat("perx");            // float 8.2
                    block.frgsvolume = query.GetFieldData(block.GetBlockName(), "frgsvolume", i).ParseLong("frgsvolume"); // long 12
                    block.orgsvolume = query.GetFieldData(block.GetBlockName(), "orgsvolume", i).ParseLong("orgsvolume"); // long 12
                    block.diff_vol   = query.GetFieldData(block.GetBlockName(), "diff_vol", i).ParseFloat("diff_vol");    // float 10.2
                    block.shcode     = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?');                // char 6
                    block.total      = query.GetFieldData(block.GetBlockName(), "total", i).ParseLong("total");           // long 12
                    block.value      = query.GetFieldData(block.GetBlockName(), "value", i).ParseLong("value");           // long 12
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
コード例 #2
0
ファイル: t1516.cs プロジェクト: tdoobw/XingAPI
 public XQt1516OutBlock1[] GetBlock1s()
 {
     XQt1516OutBlock1[] instance = XQt1516OutBlock1.ListFromQuery(this);
     return(instance);
 }