private void BackgroundWork(DoWorkEventArgs e) { using (var client = GetClient()) { ComputerInfo computer = client.GetComputerInfoFromId((int)e.Argument); ComputerLocation location = client.GetComputerLocation((int)e.Argument); LogEntry[] log = client.GetComputerLog((int)e.Argument); e.Result = (computer, location, log); } }
private static void readComputerLocations() { string[] locations = File.ReadAllLines(@"C:\AppFiles\computercoords.txt"); for (int i = 0; i < locations.Length; i++) { ComputerLocation loc = new ComputerLocation(); string[] temp = locations[i].Split(';'); loc.Name = temp[0]; loc.SubTitle = temp[1]; loc.Latitude = double.Parse(temp[2]); loc.Longitude = double.Parse(temp[3]); LocationAPI.AddComputerLocation(loc); } }