Beispiel #1
0
        public static XRs4_OutBlock FromQuery(XRs4_ query)
        {
            XRs4_OutBlock block = new XRs4_OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            try
            {
                block.sign     = query.GetFieldData(block.GetBlockName(), "sign").FirstOrDefault();           // char 1
                block.change   = query.GetFieldData(block.GetBlockName(), "change").ParseLong("change");      // long 8
                block.drate    = query.GetFieldData(block.GetBlockName(), "drate").ParseFloat("drate");       // float 6.2
                block.price    = query.GetFieldData(block.GetBlockName(), "price").ParseLong("price");        // long 8
                block.opentime = query.GetFieldData(block.GetBlockName(), "opentime").TrimEnd('?');           // char 6
                block.open     = query.GetFieldData(block.GetBlockName(), "open").ParseLong("open");          // long 8
                block.hightime = query.GetFieldData(block.GetBlockName(), "hightime").TrimEnd('?');           // char 6
                block.high     = query.GetFieldData(block.GetBlockName(), "high").ParseLong("high");          // long 8
                block.lowtime  = query.GetFieldData(block.GetBlockName(), "lowtime").TrimEnd('?');            // char 6
                block.low      = query.GetFieldData(block.GetBlockName(), "low").ParseLong("low");            // long 8
                block.shcode   = query.GetFieldData(block.GetBlockName(), "shcode").TrimEnd('?');             // char 6
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Beispiel #2
0
        public XRs4_OutBlock GetBlock()
        {
            XRs4_OutBlock instance = XRs4_OutBlock.FromQuery(this);

            return(instance);
        }