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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt2421OutBlock1 block = new XQt2421OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.dt           = query.GetFieldData(block.GetBlockName(), "dt", i).TrimEnd('?');                        // char 14
                    block.open         = query.GetFieldData(block.GetBlockName(), "open", i).ParseFloat("open");                // float 6.2
                    block.high         = query.GetFieldData(block.GetBlockName(), "high", i).ParseFloat("high");                // float 6.2
                    block.low          = query.GetFieldData(block.GetBlockName(), "low", i).ParseFloat("low");                  // float 6.2
                    block.close        = query.GetFieldData(block.GetBlockName(), "close", i).ParseFloat("close");              // float 6.2
                    block.openopenyak  = query.GetFieldData(block.GetBlockName(), "openopenyak", i).ParseLong("openopenyak");   // long 8
                    block.highopenyak  = query.GetFieldData(block.GetBlockName(), "highopenyak", i).ParseLong("highopenyak");   // long 8
                    block.lowopenyak   = query.GetFieldData(block.GetBlockName(), "lowopenyak", i).ParseLong("lowopenyak");     // long 8
                    block.closeopenyak = query.GetFieldData(block.GetBlockName(), "closeopenyak", i).ParseLong("closeopenyak"); // long 8
                    block.openupdn     = query.GetFieldData(block.GetBlockName(), "openupdn", i).ParseLong("openupdn");         // long 8
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
コード例 #2
0
ファイル: t2421.cs プロジェクト: tdoobw/XingAPI
 public XQt2421OutBlock1[] GetBlock1s()
 {
     XQt2421OutBlock1[] instance = XQt2421OutBlock1.ListFromQuery(this);
     return(instance);
 }