diff --git a/Lab1ContainersShip/Lab1ContainersShip/FormShipCollection.cs b/Lab1ContainersShip/Lab1ContainersShip/FormShipCollection.cs index dad6c6f..1612ea2 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/FormShipCollection.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/FormShipCollection.cs @@ -190,16 +190,6 @@ namespace Lab1ContainersShip { if (saveFileDialog.ShowDialog() == DialogResult.OK) { - /*if (_storage.SaveData(saveFileDialog.FileName)) - { - MessageBox.Show("Сохранение прошло успешно", - "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - MessageBox.Show("Не сохранилось", "Результат", - MessageBoxButtons.OK, MessageBoxIcon.Error); - }*/ try { _storage.SaveData(saveFileDialog.FileName); @@ -218,17 +208,6 @@ namespace Lab1ContainersShip { if (openFileDialog.ShowDialog() == DialogResult.OK) { - /*if (_storage.LoadData(openFileDialog.FileName)) - { - ReloadObjects(); - MessageBox.Show("Загрузка прошла успешно", - "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else - { - MessageBox.Show("Не загрузилось", "Результат", - MessageBoxButtons.OK, MessageBoxIcon.Error); - }*/ try { _storage.LoadData(openFileDialog.FileName); diff --git a/Lab1ContainersShip/Lab1ContainersShip/Lab1ContainersShip.csproj b/Lab1ContainersShip/Lab1ContainersShip/Lab1ContainersShip.csproj index a7f6afb..5f6ff45 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/Lab1ContainersShip.csproj +++ b/Lab1ContainersShip/Lab1ContainersShip/Lab1ContainersShip.csproj @@ -25,9 +25,4 @@ - - - Always - - \ No newline at end of file diff --git a/Lab1ContainersShip/Lab1ContainersShip/Program.cs b/Lab1ContainersShip/Lab1ContainersShip/Program.cs index 5ee455d..2686bfb 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/Program.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/Program.cs @@ -21,13 +21,6 @@ namespace Lab1ContainersShip /// /// Главная точка входа для приложения. /// - /*[STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new FormShipCollection()); - }*/ [STAThread] static void Main() { @@ -45,12 +38,6 @@ namespace Lab1ContainersShip } private static void ConfigureServices(ServiceCollection services) { - /*services.AddSingleton() - .AddLogging(option => - { - option.SetMinimumLevel(LogLevel.Information); - option.AddNLog("nlog.config"); - });*/ services.AddSingleton().AddLogging(option => { string[] path = Directory.GetCurrentDirectory().Split('\\'); diff --git a/Lab1ContainersShip/Lab1ContainersShip/SetGeneric.cs b/Lab1ContainersShip/Lab1ContainersShip/SetGeneric.cs index 00f4bb3..699b3e6 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/SetGeneric.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/SetGeneric.cs @@ -67,13 +67,11 @@ namespace Lab1ContainersShip // TODO вставка по позиции if(_places.Count >= _maxCount) { - // return false; throw new StorageOverflowException(position); } if(position < 0 || position > _places.Count) { throw new ShipNotFoundException(position); - //return false; } if(position == _places.Count) { @@ -102,7 +100,6 @@ namespace Lab1ContainersShip } else { - // return false; throw new ShipNotFoundException(position); } @@ -140,7 +137,6 @@ namespace Lab1ContainersShip set { - //Insert(value, position); try { Insert(value, position); diff --git a/Lab1ContainersShip/Lab1ContainersShip/ShipGenericStorage.cs b/Lab1ContainersShip/Lab1ContainersShip/ShipGenericStorage.cs index 37f1acd..a1622ca 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/ShipGenericStorage.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/ShipGenericStorage.cs @@ -130,7 +130,7 @@ public void SaveData(string filename) } if (data.Length == 0) { - throw new Exception("Невалиданя операция, нет данных для сохранения"); + throw new InvalidOperationException("Невалиданя операция, нет данных для сохранения"); } using(StreamWriter sr = new StreamWriter(filename)) { @@ -180,10 +180,6 @@ public void SaveData(string filename) elem?.CreateDrawingShip(_separatorForObject, _pictureWidth, _pictureHeight); if (ship != null) { - /*if (collection + ship == -1) - { - throw new Exception("Ошибка добавления в коллекцию"); - }*/ try { int t = collection + ship; diff --git a/Lab1ContainersShip/Lab1ContainersShip/nlog.config b/Lab1ContainersShip/Lab1ContainersShip/nlog.config deleted file mode 100644 index 54e4ba6..0000000 --- a/Lab1ContainersShip/Lab1ContainersShip/nlog.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - \ No newline at end of file