Example #1
0
        /// <summary>
        /// Update symbols.
        /// </summary>
        /// <param name="path">Path to json-file with list of symbols. Default Symbols.json.</param>
        public static void UpdateSymbols(string path = "Symbols.json")
        {
            DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(SymbolBox));

            using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
            {
                SymbolBox = (SymbolBox)jsonSerializer.ReadObject(fileStream);
            }
        }
Example #2
0
 static SymbolsContainer()
 {
     try
     {
         UpdateSymbols();
     }
     catch (FileNotFoundException)
     {
         SymbolBox = new SymbolBox();
     }
 }