From ad75bc4a52f602b31c1b0b01c0ef9bbf670b33e0 Mon Sep 17 00:00:00 2001 From: devil_1nc Date: Thu, 1 Dec 2022 21:24:57 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'ProjectPlane/ProjectPlane/MapsCollect?= =?UTF-8?q?ion.cs'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectPlane/ProjectPlane/MapsCollection.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ProjectPlane/ProjectPlane/MapsCollection.cs b/ProjectPlane/ProjectPlane/MapsCollection.cs index d0da14d..b443f07 100644 --- a/ProjectPlane/ProjectPlane/MapsCollection.cs +++ b/ProjectPlane/ProjectPlane/MapsCollection.cs @@ -84,7 +84,7 @@ namespace ProjectPlane byte[] info = new UTF8Encoding(true).GetBytes(text); stream.Write(info, 0, info.Length); } - public bool SaveData(string filename) + public void SaveData(string filename) { if (File.Exists(filename)) { @@ -102,7 +102,6 @@ namespace ProjectPlane ); } } - return true; } @@ -111,11 +110,11 @@ namespace ProjectPlane /// /// /// - public bool LoadData(string filename) + public void LoadData(string filename) { if (!File.Exists(filename)) { - return false; + throw new Exception("File not found"); } string bufferTextFromFile = ""; using (FileStream fs = new(filename, FileMode.Open)) @@ -125,7 +124,7 @@ namespace ProjectPlane if (!curLine.Contains("MapsCollection")) { - return false; + throw new Exception("Incorrect format"); } _mapStorages.Clear(); @@ -147,7 +146,6 @@ namespace ProjectPlane } } - return true; } } } \ No newline at end of file