Исправления
This commit is contained in:
parent
86430cf93c
commit
0105985c98
@ -100,13 +100,12 @@ namespace ProjectMachine
|
||||
{
|
||||
File.Delete(filename);
|
||||
}
|
||||
using (FileStream fs = new(filename, FileMode.Create))
|
||||
using (StreamWriter f = new(filename))
|
||||
{
|
||||
WriteToFile($"MapsCollection{Environment.NewLine}", fs);
|
||||
f.Write($"MapsCollection{Environment.NewLine}");
|
||||
foreach (var storage in _mapStorages)
|
||||
{
|
||||
|
||||
WriteToFile($"{storage.Key}{separatorDict}{storage.Value.GetData(separatorDict,separatorData)}{Environment.NewLine}", fs);
|
||||
f.Write($"{storage.Key}{separatorDict}{storage.Value.GetData(separatorDict, separatorData)}{Environment.NewLine}");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@ -127,7 +126,7 @@ namespace ProjectMachine
|
||||
if (!f.ReadLine().Contains("MapsCollection"))
|
||||
{
|
||||
//если нет такой записи, то это не те данные
|
||||
throw new Exception("Формат данных в файле не правильный");
|
||||
return false;
|
||||
}
|
||||
//очищаем записи
|
||||
_mapStorages.Clear();
|
||||
|
Loading…
Reference in New Issue
Block a user