Ejemplo n.º 1
0
        public static XQt8409OutBlock1[] ListFromQuery(XQt8409 query)
        {
            int count = query.GetBlockCount(XQt8409OutBlock1.BlockName);
            List <XQt8409OutBlock1> list = new List <XQt8409OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt8409OutBlock1 block = new XQt8409OutBlock1();
                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());
        }
Ejemplo n.º 2
0
 public XQt8409OutBlock1[] GetBlock1s()
 {
     XQt8409OutBlock1[] instance = XQt8409OutBlock1.ListFromQuery(this);
     return(instance);
 }