public Form1() { clientCollection = ClientCollection.GetJSON(); f2 = new Form2(clientCollection.clientList.ElementAt(0)); InitializeComponent(); this.Load += new EventHandler(Form1_Load); }
static public ClientCollection GetJSON() { ClientCollection fileClients = null; string rawJSON = System.IO.File.ReadAllText(@"C:\Users\~\source\repos\testDataGrid\testDataGrid\clients.json"); fileClients = JsonConvert.DeserializeObject <ClientCollection>(rawJSON); return(fileClients); }