From ccdd7b9c59a6be46181cbed71e0e39417ac569c9 Mon Sep 17 00:00:00 2001 From: Esenia12 <148366616+Esenia12@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:28:09 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=20=E2=84=967?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractCompany.cs | 8 +- .../CarSharingService.cs | 4 +- .../ListGenericObjects.cs | 42 +++--- .../MassiveGenericObjects.cs | 34 ++--- .../StorageCollection.cs | 40 +++--- .../Exceptions/CollectionOverflowException.cs | 15 ++ .../Exceptions/ObjectNotFoundException.cs | 15 ++ .../PositionOutOfCollectionException.cs | 17 +++ .../ProjectDumpTruck/FormTrackCollection.cs | 136 +++++++++++------- ProjectDumpTruck/ProjectDumpTruck/Program.cs | 40 +++++- .../ProjectDumpTruck/ProjectDumpTruck.csproj | 16 +++ ProjectDumpTruck/ProjectDumpTruck/T.cs | 3 + .../ProjectDumpTruck/serilog.Designer.json | 36 +++++ .../ProjectDumpTruck/serilog.json | 15 ++ Файл с данными.txt | 4 +- 15 files changed, 309 insertions(+), 116 deletions(-) create mode 100644 ProjectDumpTruck/ProjectDumpTruck/Exceptions/CollectionOverflowException.cs create mode 100644 ProjectDumpTruck/ProjectDumpTruck/Exceptions/ObjectNotFoundException.cs create mode 100644 ProjectDumpTruck/ProjectDumpTruck/Exceptions/PositionOutOfCollectionException.cs create mode 100644 ProjectDumpTruck/ProjectDumpTruck/T.cs create mode 100644 ProjectDumpTruck/ProjectDumpTruck/serilog.Designer.json create mode 100644 ProjectDumpTruck/ProjectDumpTruck/serilog.json diff --git a/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/AbstractCompany.cs b/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/AbstractCompany.cs index ca1c40a..eb0dd5b 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/AbstractCompany.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/AbstractCompany.cs @@ -92,8 +92,12 @@ public abstract class AbstractCompany SetObjectsPosition(); for (int i = 0; i < (_collection?.Count ?? 0); ++i) { - DrawningTrack? obj = _collection?.Get(i); - obj?.DrawTransport(graphics); + try + { + DrawningTrack? obj = _collection?.Get(i); + obj?.DrawTransport(graphics); + } + catch (Exception) { } } return bitmap; diff --git a/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/CarSharingService.cs b/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/CarSharingService.cs index 8793a1c..c9b8ea4 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/CarSharingService.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/CarSharingService.cs @@ -43,12 +43,12 @@ public class CarSharingService : AbstractCompany for (int i = 0; i < (_collection?.Count ?? 0); i++) { - if (_collection.Get(i) != null) + try { _collection.Get(i).SetPictureSize(_pictureWidth, _pictureHeight); _collection.Get(i).SetPosition(_placeSizeWidth * curWidth + 20, curHeight * _placeSizeHeight + 20); } - + catch (Exception) { } if (curWidth < width-1) curWidth++; else diff --git a/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/ListGenericObjects.cs b/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/ListGenericObjects.cs index 6f79745..dcd514d 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/ListGenericObjects.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/ListGenericObjects.cs @@ -1,4 +1,7 @@ -namespace ProjectDumpTruck.CollectionGenericObjects; +using Microsoft.Extensions.Logging; +using ProjectDumpTruck.Exceptions; + +namespace ProjectDumpTruck.CollectionGenericObjects; /// /// Параметризованный набор объектов @@ -46,36 +49,33 @@ public class ListGenericObjects : ICollectionGenericObjects public T Get(int position) { - // TODO проверка позиции - if (position >= Count || position < 0) return null; + //TODO выброс ошибки если выход за границу + if (position >= Count || position < 0) throw new PositionOutOfCollectionException(position); return _collection[position]; } - - public int Insert(T obj) - { - // TODO проверка, что не превышено максимальное количество элементов - // TODO вставка в конец набора - if (Count == _maxCount) return -1; - _collection.Add(obj); - return Count; - } - + public int Insert(T obj) + { + + // TODO выброс ошибки если переполнение + if (Count == _maxCount) throw new CollectionOverflowException(Count); + _collection.Add(obj); + return Count; + } + public int Insert(T obj, int position) { - // TODO проверка, что не превышено максимальное количество элементов - // TODO проверка позиции - // TODO вставка по позиции - if (Count == _maxCount) return -1; - if (position >= Count || position < 0) return -1; + // TODO выброс ошибки если переполнение + // TODO выброс ошибки если за границу + if (Count == _maxCount) throw new CollectionOverflowException(Count); + if (position >= Count || position < 0) throw new PositionOutOfCollectionException(position); _collection.Insert(position, obj); return position; } public T Remove(int position) { - // TODO проверка позиции - // TODO удаление объекта из списка - if (position >= _collection.Count || position < 0) return null; + // TODO если выброс за границу + if (position >= Count || position < 0) throw new PositionOutOfCollectionException(position); T obj = _collection[position]; _collection.RemoveAt(position); return obj; diff --git a/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/MassiveGenericObjects.cs b/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/MassiveGenericObjects.cs index 8a9c762..4f57f68 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/MassiveGenericObjects.cs @@ -1,4 +1,4 @@ - +using ProjectDumpTruck.Exceptions; namespace ProjectDumpTruck.CollectionGenericObjects; internal class MassiveGenericObjects : ICollectionGenericObjects @@ -45,16 +45,20 @@ internal class MassiveGenericObjects : ICollectionGenericObjects public T? Get(int position) { - // TODO проверка позиции - if (position >= _collection.Length || position < 0) return null; + // TODO выброс ошибки если выход за границу + // TODO выброс ошибки если объект пустой + if (position >= _collection.Length || position < 0) throw new PositionOutOfCollectionException(position); + if (_collection[position] == null) throw new ObjectNotFoundException(position); return _collection[position]; } public int Insert(T obj) { - // TODO вставка в свободное место набора + + // TODO выброс ошибки если переполнение + int index = 0; - while (index < _collection.Length) + while (index < _collection.Length - 1) { if (_collection[index] == null) { @@ -63,17 +67,14 @@ internal class MassiveGenericObjects : ICollectionGenericObjects } index++; } - return -1; + throw new CollectionOverflowException(Count); } public int Insert(T obj, int position) { - // TODO проверка позиции - // TODO проверка, что элемент массива по этой позиции пустой, если нет, то - // ищется свободное место после этой позиции и идет вставка туда - // если нет после, ищем до - // TODO вставка - if (position >= _collection.Length || position < 0) return -1; + + // TODO выброс ошибки если выход за границу + if (position >= _collection.Length || position < 0) throw new PositionOutOfCollectionException(position); if (_collection[position] == null) { _collection[position] = obj; @@ -99,14 +100,15 @@ internal class MassiveGenericObjects : ICollectionGenericObjects } index--; } - return -1; + throw new CollectionOverflowException(Count); } public T? Remove(int position) { - // TODO проверка позиции - // TODO удаление объекта из массива, присвоив элементу массива значение null - if (position >= _collection.Length || position < 0) return null; + + // TODO выброс ошибки если объект пустой + if (position >= _collection.Length || position < 0) throw new PositionOutOfCollectionException(position); + if (_collection[position] == null) throw new ObjectNotFoundException(position); T removeObj = _collection[position]; _collection[position] = null; return removeObj; diff --git a/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/StorageCollection.cs b/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/StorageCollection.cs index e650579..5c2449c 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/StorageCollection.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/CollectionGenericObjects/StorageCollection.cs @@ -1,6 +1,6 @@ using ProjectDumpTrack.Drawnings; using System.Text; - +using ProjectDumpTruck.Exceptions; namespace ProjectDumpTruck.CollectionGenericObjects; /// @@ -93,11 +93,11 @@ public class StorageCollection /// /// Путь и имя файла /// true - сохранение прошло успешно, false - ошибка при сохранении данных - public bool SaveData(string filename) + public void SaveData(string filename) { if (_storages.Count == 0) { - return false; + throw new Exception("В хранилище отсутствуют коллекции для сохранения"); } if (File.Exists(filename)) { @@ -110,7 +110,6 @@ public class StorageCollection { StringBuilder sb = new(); sb.Append(Environment.NewLine); - // не сохраняем пустые коллекции if (value.Value.Count == 0) { continue; @@ -135,7 +134,7 @@ public class StorageCollection } } - return true; + } /// @@ -143,32 +142,28 @@ public class StorageCollection /// /// Путь и имя файла /// true - загрузка прошла успешно, false - ошибка при загрузке данных - public bool LoadData(string filename) + public void LoadData(string filename) { if (!File.Exists(filename)) { - return false; + throw new Exception("Файл не существует"); } using (StreamReader fs = File.OpenText(filename)) { string str = fs.ReadLine(); if (str == null || str.Length == 0) { - return false; + throw new Exception("В файле нет данных"); } if (!str.StartsWith(_collectionKey)) { - return false; + throw new Exception("В файле неверные данные"); } _storages.Clear(); string strs = ""; while ((strs = fs.ReadLine()) != null) { - //по идее этого произойти не должно - //if (strs == null) - //{ - // return false; - //} + string[] record = strs.Split(_separatorForKeyValue, StringSplitOptions.RemoveEmptyEntries); if (record.Length != 4) { @@ -178,23 +173,30 @@ public class StorageCollection ICollectionGenericObjects? collection = StorageCollection.CreateCollection(collectionType); if (collection == null) { - return false; + throw new Exception("Не удалось создать коллекцию"); } collection.MaxCount = Convert.ToInt32(record[2]); string[] set = record[3].Split(_separatorItems, StringSplitOptions.RemoveEmptyEntries); foreach (string elem in set) { - if (elem?.CreateDrawningTrack() is T ship) + if (elem?.CreateDrawningTrack() is T track) { - if (collection.Insert(ship) == -1) + try { - return false; + if (collection.Insert(track) == -1) + { + throw new Exception("Объект не удалось добавить в коллекцию: " + record[3]); + } + } + catch (CollectionOverflowException ex) + { + throw new Exception("Коллекция переполнена", ex); } } } _storages.Add(record[0], collection); } - return true; + } } diff --git a/ProjectDumpTruck/ProjectDumpTruck/Exceptions/CollectionOverflowException.cs b/ProjectDumpTruck/ProjectDumpTruck/Exceptions/CollectionOverflowException.cs new file mode 100644 index 0000000..fe5562f --- /dev/null +++ b/ProjectDumpTruck/ProjectDumpTruck/Exceptions/CollectionOverflowException.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +namespace ProjectDumpTruck.Exceptions; + +/// +/// Класс, описывающий ошибку переполнения коллекции +/// +[Serializable] +internal class CollectionOverflowException : ApplicationException +{ + public CollectionOverflowException(int count) : base("В коллекции превышено допустимое количество: " + count) { } + public CollectionOverflowException() : base() { } + public CollectionOverflowException(string message) : base(message) { } + public CollectionOverflowException(string message, Exception exception) : base(message, exception) { } + protected CollectionOverflowException(SerializationInfo info, StreamingContext contex) : base(info, contex) { } +} diff --git a/ProjectDumpTruck/ProjectDumpTruck/Exceptions/ObjectNotFoundException.cs b/ProjectDumpTruck/ProjectDumpTruck/Exceptions/ObjectNotFoundException.cs new file mode 100644 index 0000000..a448d7b --- /dev/null +++ b/ProjectDumpTruck/ProjectDumpTruck/Exceptions/ObjectNotFoundException.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +namespace ProjectDumpTruck.Exceptions; + +/// +/// Класс, описывающий ошибку, что по указанной позиции нет элемента +/// +[Serializable] +internal class ObjectNotFoundException : ApplicationException +{ + public ObjectNotFoundException(int i) : base("Не найден объект по позиции " + i) { } + public ObjectNotFoundException() : base() { } + public ObjectNotFoundException(string message) : base(message) { } + public ObjectNotFoundException(string message, Exception exception) : base(message, exception) { } + protected ObjectNotFoundException(SerializationInfo info, StreamingContext contex) : base(info, contex) { } +} diff --git a/ProjectDumpTruck/ProjectDumpTruck/Exceptions/PositionOutOfCollectionException.cs b/ProjectDumpTruck/ProjectDumpTruck/Exceptions/PositionOutOfCollectionException.cs new file mode 100644 index 0000000..688aef2 --- /dev/null +++ b/ProjectDumpTruck/ProjectDumpTruck/Exceptions/PositionOutOfCollectionException.cs @@ -0,0 +1,17 @@ + +using System.Runtime.Serialization; + +namespace ProjectDumpTruck.Exceptions; + +/// +/// Класс, описывающий ошибку выхода за границы коллекции +/// +[Serializable] +internal class PositionOutOfCollectionException : ApplicationException +{ + public PositionOutOfCollectionException(int i) : base("Выход за границы коллекции.Позиция " + i) { } + public PositionOutOfCollectionException() : base() { } + public PositionOutOfCollectionException(string message) : base(message) { } + public PositionOutOfCollectionException(string message, Exception exception) : base(message, exception) { } + protected PositionOutOfCollectionException(SerializationInfo info, StreamingContext contex) : base(info, contex) { } +} diff --git a/ProjectDumpTruck/ProjectDumpTruck/FormTrackCollection.cs b/ProjectDumpTruck/ProjectDumpTruck/FormTrackCollection.cs index 7a44ddc..c1bf927 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/FormTrackCollection.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/FormTrackCollection.cs @@ -1,8 +1,8 @@  +using Microsoft.Extensions.Logging; using ProjectDumpTruck.CollectionGenericObjects; using ProjectDumpTrack.Drawnings; -using System.Windows.Forms; - +using ProjectDumpTruck.Exceptions; namespace ProjectDumpTruck; /// @@ -23,10 +23,13 @@ public partial class FormTrackCollection : Form /// /// Конструктор /// - public FormTrackCollection() + private readonly ILogger _logger; + public FormTrackCollection(ILogger logger) { InitializeComponent(); _storageCollection = new(); + _logger = logger; + _logger.LogInformation("Форма загрузилась"); } /// @@ -72,18 +75,24 @@ public partial class FormTrackCollection : Form private void SetCar(DrawningTrack track) { - if (_company == null || track == null) + try { - return; + if (_company == null || track == null) + { + return; + } + if (_company + track != -1) + { + MessageBox.Show("Объект добавлен"); + pictureBox.Image = _company.Show(); + _logger.LogInformation("Добавлен объект: " + track.GetDataForSave()); + } } - if (_company + track != -1) - { - MessageBox.Show("Объект добавлен"); - pictureBox.Image = _company.Show(); - } - else + catch (ObjectNotFoundException) { } + catch (CollectionOverflowException ex) { MessageBox.Show("Не удалось добавить объект"); + _logger.LogError("Ошибка: {Message}", ex.Message); } } @@ -124,14 +133,19 @@ public partial class FormTrackCollection : Form } int pos = Convert.ToInt32(maskedTextBox.Text); - if (_company - pos != null) + try { - MessageBox.Show("Объект удален"); - pictureBox.Image = _company.Show(); + if (_company - pos != null) + { + MessageBox.Show("Объект удален"); + pictureBox.Image = _company.Show(); + _logger.LogInformation("Удален объект по позиции " + pos); + } } - else + catch (Exception ex) { MessageBox.Show("Не удалось удалить объект"); + _logger.LogError("Ошибка: {Message}", ex.Message); } } @@ -149,26 +163,28 @@ public partial class FormTrackCollection : Form DrawningTrack? track = null; int counter = 100; - while (track == null) + try { - track = _company.GetRandomObject(); - counter--; - if (counter <= 0) + while (track == null) { - break; + track = _company.GetRandomObject(); + counter--; + if (counter <= 0) + { + break; + } } + FormTransport Form = new() + { + SetTrack = track + }; + Form.ShowDialog(); } + catch (Exception ex) - if (track == null) { - return; + MessageBox.Show(ex.Message, "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); } - - FormTransport form = new() - { - SetTrack = track - }; - form.ShowDialog(); } /// @@ -199,17 +215,25 @@ public partial class FormTrackCollection : Form return; } - CollectionType collectionType = CollectionType.None; - if (radioButtonMassive.Checked) + try { - collectionType = CollectionType.Massive; + CollectionType collectionType = CollectionType.None; + if (radioButtonMassive.Checked) + { + collectionType = CollectionType.Massive; + } + else if (radioButtonList.Checked) + { + collectionType = CollectionType.List; + } + _storageCollection.AddCollection(textBoxCollectionName.Text, collectionType); + RerfreshListBoxItems(); + _logger.LogInformation("Коллекция добавлена " + textBoxCollectionName.Text); } - else if (radioButtonList.Checked) + catch (Exception ex) { - collectionType = CollectionType.List; + _logger.LogError("Ошибка: {Message}", ex.Message); } - - _storageCollection.AddCollection(textBoxCollectionName.Text, collectionType); RerfreshListBoxItems(); } @@ -247,12 +271,21 @@ public partial class FormTrackCollection : Form return; } - if (MessageBox.Show("Удалить коллекцию?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + try { - return; + if (MessageBox.Show("Удалить коллекцию?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + _storageCollection.DelCollection(listBoxCollection.SelectedItem.ToString()); + RerfreshListBoxItems(); + _logger.LogInformation("Коллекция: " + listBoxCollection.SelectedItem.ToString() + " удалена"); } - _storageCollection.DelCollection(listBoxCollection.SelectedItem.ToString()); - RerfreshListBoxItems(); + catch (Exception ex) + { + _logger.LogError("Ошибка: {Message}", ex.Message); + } + } /// @@ -295,13 +328,16 @@ public partial class FormTrackCollection : Form { if (saveFileDialog.ShowDialog() == DialogResult.OK) { - if (_storageCollection.SaveData(saveFileDialog.FileName)) + try { + _storageCollection.SaveData(saveFileDialog.FileName); MessageBox.Show("Сохранение прошло успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); + _logger.LogInformation("Сохранение в файл: {filename}", saveFileDialog.FileName); } - else + catch (Exception ex) { - MessageBox.Show("Не сохранилось", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(ex.Message, "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); + _logger.LogError("Ошибка: {Message}", ex.Message); } } } @@ -310,20 +346,22 @@ public partial class FormTrackCollection : Form { if (openFileDialog.ShowDialog() == DialogResult.OK) { - if (_storageCollection.LoadData(openFileDialog.FileName)) + try { - MessageBox.Show("Загрузка прошла успешно", - "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); + _storageCollection.LoadData(openFileDialog.FileName); + MessageBox.Show("Загрузка прошла успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); RerfreshListBoxItems(); + _logger.LogInformation("Загрузка из файла: {filename}", openFileDialog.FileName); } - else + catch (Exception ex) { - MessageBox.Show("Не сохранилось", "Результат", - MessageBoxButtons.OK, MessageBoxIcon.Error); + + MessageBox.Show("Не сохранилось", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); + _logger.LogError("Ошибка: {Message}", ex.Message); } } - } + } } diff --git a/ProjectDumpTruck/ProjectDumpTruck/Program.cs b/ProjectDumpTruck/ProjectDumpTruck/Program.cs index e696463..2c4a83b 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/Program.cs +++ b/ProjectDumpTruck/ProjectDumpTruck/Program.cs @@ -1,4 +1,9 @@ -using ProjectDumpTruck.MovementStrategy; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +using Serilog; +using Microsoft.Extensions.Configuration; + namespace ProjectDumpTruck { @@ -13,11 +18,36 @@ namespace ProjectDumpTruck // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new FormTrackCollection()); - + + ServiceCollection services = new(); + ConfigureServices(services); + using ServiceProvider serviceProvider = services.BuildServiceProvider(); + Application.Run(serviceProvider.GetRequiredService()); + } + + + + private static void ConfigureServices(ServiceCollection services) + { + + string[] path = Directory.GetCurrentDirectory().Split('\\'); + string pathNeed = ""; + for (int i = 0; i < path.Length - 3; i++) + { + pathNeed += path[i] + "\\"; + } - + services.AddSingleton() + .AddLogging(option => + { + option.SetMinimumLevel(LogLevel.Information); + option.AddSerilog(new LoggerConfiguration() + .ReadFrom.Configuration(new ConfigurationBuilder() + .AddJsonFile($"{pathNeed}serilog.json") + .Build()) + .CreateLogger()); + }); + } } } -} \ No newline at end of file diff --git a/ProjectDumpTruck/ProjectDumpTruck/ProjectDumpTruck.csproj b/ProjectDumpTruck/ProjectDumpTruck/ProjectDumpTruck.csproj index 13ee123..7c56274 100644 --- a/ProjectDumpTruck/ProjectDumpTruck/ProjectDumpTruck.csproj +++ b/ProjectDumpTruck/ProjectDumpTruck/ProjectDumpTruck.csproj @@ -8,6 +8,22 @@ enable + + + + + + + + + + + + + + + + True diff --git a/ProjectDumpTruck/ProjectDumpTruck/T.cs b/ProjectDumpTruck/ProjectDumpTruck/T.cs new file mode 100644 index 0000000..d361d55 --- /dev/null +++ b/ProjectDumpTruck/ProjectDumpTruck/T.cs @@ -0,0 +1,3 @@ +internal class T +{ +} \ No newline at end of file diff --git a/ProjectDumpTruck/ProjectDumpTruck/serilog.Designer.json b/ProjectDumpTruck/ProjectDumpTruck/serilog.Designer.json new file mode 100644 index 0000000..e301dc2 --- /dev/null +++ b/ProjectDumpTruck/ProjectDumpTruck/serilog.Designer.json @@ -0,0 +1,36 @@ +namespace ProjectDumpTruck +{ + partial class serilog + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + + #endregion + } +} diff --git a/ProjectDumpTruck/ProjectDumpTruck/serilog.json b/ProjectDumpTruck/ProjectDumpTruck/serilog.json new file mode 100644 index 0000000..d1428e1 --- /dev/null +++ b/ProjectDumpTruck/ProjectDumpTruck/serilog.json @@ -0,0 +1,15 @@ +{ + "Serilog": { + "Using": [ "Serilog.Sinks.File" ], + "MinimumLevel": "Debug", + "WriteTo": [ + { + "Name": "File", + "Args": { "path": "log.log" } + } + ], + "Properties": { + "Application": "Sample" + } + } +} diff --git a/Файл с данными.txt b/Файл с данными.txt index 5f8f2e5..1b05777 100644 --- a/Файл с данными.txt +++ b/Файл с данными.txt @@ -1,3 +1,3 @@ CollectionsStorage -v|Massive|32|EntityTrack:100:100:Aqua;EntityDumpTrack:5:45:White:Black:Red:True:True;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua; -c|List|1|EntityTrack:100:100:Gray; \ No newline at end of file +м|Massive|18|EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua; +с|List|4|EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua;EntityTrack:100:100:Aqua; \ No newline at end of file -- 2.25.1