Exemple #1
0
        public static XRI5_OutBlock FromQuery(XRI5_ query)
        {
            XRI5_OutBlock block = new XRI5_OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            try
            {
                block.time      = query.GetFieldData(block.GetBlockName(), "time").TrimEnd('?');                 // char 8
                block.price     = query.GetFieldData(block.GetBlockName(), "price").ParseLong("price");          // long 8
                block.sign      = query.GetFieldData(block.GetBlockName(), "sign").FirstOrDefault();             // char 1
                block.change    = query.GetFieldData(block.GetBlockName(), "change").ParseLong("change");        // long 8
                block.volume    = query.GetFieldData(block.GetBlockName(), "volume").ParseFloat("volume");       // float 12
                block.navdiff   = query.GetFieldData(block.GetBlockName(), "navdiff").ParseFloat("navdiff");     // float 9.2
                block.nav       = query.GetFieldData(block.GetBlockName(), "nav").ParseFloat("nav");             // float 9.2
                block.navchange = query.GetFieldData(block.GetBlockName(), "navchange").ParseFloat("navchange"); // float 9.2
                block.crate     = query.GetFieldData(block.GetBlockName(), "crate").ParseFloat("crate");         // float 9.2
                block.grate     = query.GetFieldData(block.GetBlockName(), "grate").ParseFloat("grate");         // float 9.2
                block.jisu      = query.GetFieldData(block.GetBlockName(), "jisu").ParseFloat("jisu");           // float 8.2
                block.jichange  = query.GetFieldData(block.GetBlockName(), "jichange").ParseFloat("jichange");   // float 8.2
                block.jirate    = query.GetFieldData(block.GetBlockName(), "jirate").ParseFloat("jirate");       // float 8.2
                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);
        }
Exemple #2
0
        public XRI5_OutBlock GetBlock()
        {
            XRI5_OutBlock instance = XRI5_OutBlock.FromQuery(this);

            return(instance);
        }