после доп задания

This commit is contained in:
AnnaLioness 2023-12-01 15:28:29 +04:00
parent 256a3c4bf4
commit d0e1ba4024

View File

@ -190,5 +190,28 @@ public bool SaveData(string filename)
}
return true;
}
public bool SaveDop(string filename, string key)
{
if (File.Exists(filename))
{
File.Delete(filename);
}
StringBuilder data = new StringBuilder();
ShipGenericCollection<DrawingShip, DrawningObjectShip> record = _shipStorages[key];
if (!_shipStorages.ContainsKey(key))
{
return false;
}
if(record != null)
{
using (StreamWriter sr = new StreamWriter(filename))
{
sr.Write(filename + " ");
sr.WriteLine(record);
return true;
}
}
return false;
}
}
}