Exemplo n.º 1
0
        public List <DeskQuote> readJSONFile(string file)
        {
            StreamReader     sr         = new StreamReader(file);
            List <DeskQuote> deskQuotes = new List <DeskQuote>();
            string           JSONString;

            try
            {
                while (!sr.EndOfStream)
                {
                    JSONString = sr.ReadLine();
                    DeskQuote deskQuote = new DeskQuote();
                    deskQuote = JsonConvert.DeserializeObject <DeskQuote>(JSONString);
                    deskQuotes.Add(deskQuote);
                }
            }
            catch (IOException e)
            {
                System.Windows.Forms.MessageBox.Show("There was a problem trying to read the file" + e);
            }
            sr.Close();
            return(deskQuotes);
        }