Beispiel #1
0
        public static XQt1449OutBlock1[] ListFromQuery(XQt1449 query)
        {
            int count = query.GetBlockCount(XQt1449OutBlock1.BlockName);
            List <XQt1449OutBlock1> list = new List <XQt1449OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1449OutBlock1 block = new XQt1449OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    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.tickdiff = query.GetFieldData(block.GetBlockName(), "tickdiff", i).ParseFloat("tickdiff");       // float 6.2
                    block.cvolume  = query.GetFieldData(block.GetBlockName(), "cvolume", i).ParseLong("cvolume");          // long 12
                    block.diff     = query.GetFieldData(block.GetBlockName(), "diff", i).ParseFloat("diff");               // float 6.2
                    block.mdvolume = query.GetFieldData(block.GetBlockName(), "mdvolume", i).ParseLong("mdvolume");        // long 12
                    block.msvolume = query.GetFieldData(block.GetBlockName(), "msvolume", i).ParseLong("msvolume");        // long 12
                    block.msdiff   = query.GetFieldData(block.GetBlockName(), "msdiff", i).ParseFloat("msdiff");           // float 6.2
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Beispiel #2
0
 public XQt1449OutBlock1[] GetBlock1s()
 {
     XQt1449OutBlock1[] instance = XQt1449OutBlock1.ListFromQuery(this);
     return(instance);
 }