private void writeFile(Dictionary <string, Boat> list, string pathSaveFile) { foreach (var item in list) { mutex.WaitOne(); JsonToolBoat.writeFileJson(pathSaveFile + "\\" + item.Key + ".json", item.Value); numprogressSaveFile++; mutex.ReleaseMutex(); } MessageBox.Show("Hoàn Thành"); }
//xu ly file private void handlingFile(string filename) { Boat boat = new Boat(); boat = JsonToolBoat.readFileJson(filename); mutex.WaitOne(); if (checkMmsi(boat.Mmsi)) { if (checkDate(boat)) { addCoordinateToBoat(boat); } } else { ListBoat.Add(boat.Mmsi, boat); } mutex.ReleaseMutex(); }