PIbd-22. Shabunov O.A. Lab work 07 #7

Closed
olshab wants to merge 8 commits from Lab7 into Lab6
Showing only changes of commit 469dc33087 - Show all commits

View File

@ -58,7 +58,7 @@ namespace AirBomber.Generics
public bool SaveData(string FileName)
{
if (_entityStorages.Count == 0)
return false;
throw new Exception("Невалиданя операция, нет данных для сохранения");
using (StreamWriter writer = new StreamWriter(FileName, false))
{
@ -81,12 +81,12 @@ namespace AirBomber.Generics
public bool LoadData(string FileName)
{
if (!File.Exists(FileName))
return false;
throw new Exception("Файл не найден");
using (StreamReader reader = new StreamReader(FileName))
{
if (reader.ReadLine() != "BomberStorage")
return false;
throw new Exception("Неверный формат данных");
_entityStorages.Clear();
@ -108,7 +108,7 @@ namespace AirBomber.Generics
if (Renderer != null)
{
if ((Collection + Renderer) == -1)
return false;
throw new Exception("Ошибка добавления в коллекцию");
}
}