예제 #1
0
        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");
        }
예제 #2
0
        //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();
        }