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

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt2835OutBlock2 block = new XQt2835OutBlock2();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.actprice  = query.GetFieldData(block.GetBlockName(), "actprice", i).ParseFloat("actprice");     // float 6.2
                    block.optcode   = query.GetFieldData(block.GetBlockName(), "optcode", i).TrimEnd('?');                // char 8
                    block.price     = query.GetFieldData(block.GetBlockName(), "price", i).ParseFloat("price");           // float 6.2
                    block.sign      = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault();               // char 1
                    block.change    = query.GetFieldData(block.GetBlockName(), "change", i).ParseFloat("change");         // float 6.2
                    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.offerho1  = query.GetFieldData(block.GetBlockName(), "offerho1", i).ParseFloat("offerho1");     // float 6.2
                    block.bidho1    = query.GetFieldData(block.GetBlockName(), "bidho1", i).ParseFloat("bidho1");         // float 6.2
                    block.cvolume   = query.GetFieldData(block.GetBlockName(), "cvolume", i).ParseLong("cvolume");        // long 12
                    block.impv      = query.GetFieldData(block.GetBlockName(), "impv", i).ParseFloat("impv");             // float 6.2
                    block.timevl    = query.GetFieldData(block.GetBlockName(), "timevl", i).ParseFloat("timevl");         // float 6.2
                    block.offerrem1 = query.GetFieldData(block.GetBlockName(), "offerrem1", i).ParseLong("offerrem1");    // long 12
                    block.bidrem1   = query.GetFieldData(block.GetBlockName(), "bidrem1", i).ParseLong("bidrem1");        // long 12
                    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.atmgubun  = query.GetFieldData(block.GetBlockName(), "atmgubun", i).FirstOrDefault();           // char 1
                    block.jisuconv  = query.GetFieldData(block.GetBlockName(), "jisuconv", i).ParseFloat("jisuconv");     // float 6.2
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Exemple #2
0
 public XQt2835OutBlock2[] GetBlock2s()
 {
     XQt2835OutBlock2[] instance = XQt2835OutBlock2.ListFromQuery(this);
     return(instance);
 }