Esempio n. 1
0
        public override Chart Load(string path)
        {
            BMSONChart  chart       = null;
            BMSONHeader bmsonHeader = null;

            try
            {
                using (StreamReader streamReader = new StreamReader(path, Encoding.UTF8))
                {
                    if (headerOnly)
                    {
                        bmsonHeader = JSON.Deserialize <BMSONHeader>(streamReader);
                    }
                    else
                    {
                        bmsonHeader = JSON.Deserialize <BMSON>(streamReader);
                    }
                }
            }
            catch (Exception e)
            {
                Log.Error("Failed to parse BMSON file: " + e.Message);
                return(null);
            }

            if (bmsonHeader != null)
            {
                chart = new BMSONChart(Directory.GetParent(path).FullName, bmsonHeader);
            }

            return(chart);
        }
Esempio n. 2
0
 public BMSONChart(string basePath, BMSONHeader bmson)
     : base(basePath)
 {
     this.bmson = bmson;
 }