Compare commits

..

No commits in common. "7ac785ccfd3b55745e3272b972ac59c4afc432d0" and "3d5e3f3cdc16d70bd49dad0a6ed8a8c9e50fd21e" have entirely different histories.

12 changed files with 80 additions and 266 deletions

View File

@ -1,6 +1,4 @@
using ProjectLiner.CollectionGenericObjects; using ProjectLiner.CollectionGenericObjects;
using ProjectLiner.Exceptions;
using System.Collections.Generic;
/// <summary> /// <summary>
/// Параметризованный набор объектов /// Параметризованный набор объектов
@ -12,12 +10,12 @@ public class ListGenericObjects<T> : ICollectionGenericObjects<T>
/// <summary> /// <summary>
/// Список объектов, которые храним /// Список объектов, которые храним
/// </summary> /// </summary>
private readonly List<T?> _collection; private readonly Dictionary<int, T> _collection;
/// <summary> /// <summary>
/// Максимально допустимое число объектов в списке /// Максимально допустимое число объектов в списке
/// </summary> /// </summary>
private int _maxCount; private int _maxCount;
public int Count => _collection.Count; public int Count => _collection.Keys.Count;
public int MaxCount public int MaxCount
{ {
get get
@ -45,34 +43,27 @@ public class ListGenericObjects<T> : ICollectionGenericObjects<T>
} }
public T? Get(int position) public T? Get(int position)
{ {
// Проверка позиции if (position >= Count || position < 0) return null;
if (position >= Count || position < 0)
{
throw new PositionOutOfCollectionException(position);
}
return _collection[position]; return _collection[position];
} }
public int Insert(T obj) public int Insert(T obj)
{ {
if (Count == _maxCount) throw new CollectionOverflowException(); if (Count > _maxCount) return -1;
_collection.Add(obj); _collection[Count-1] = obj;
return Count; return Count;
} }
public int Insert(T obj, int position) public int Insert(T obj, int position)
{ {
if (Count == _maxCount) throw new CollectionOverflowException(); if (Count > _maxCount) return -1;
if (position >= Count || position < 0) throw new PositionOutOfCollectionException(); _collection[position] = obj;
_collection.Insert(position, obj); return 1;
return position;
} }
public T? Remove(int position)
public T Remove(int position)
{ {
if (position >= Count || position < 0) throw new PositionOutOfCollectionException(); if (_collection.ContainsKey(position)) return null;
T obj = _collection[position]; T? temp = _collection[position];
_collection.RemoveAt(position); _collection.Remove(position);
return obj; return temp;
} }
public IEnumerable<T?> GetItems() public IEnumerable<T?> GetItems()

View File

@ -1,6 +1,4 @@
 
using ProjectLiner.Exceptions;
namespace ProjectLiner.CollectionGenericObjects namespace ProjectLiner.CollectionGenericObjects
{ {
/// <summary> /// <summary>
@ -52,7 +50,8 @@ namespace ProjectLiner.CollectionGenericObjects
public T? Get(int position) public T? Get(int position)
{ {
if (position < 0 || position >= Count) throw new PositionOutOfCollectionException(); if (position < 0 || position >= Count)
return null;
return _collection[position]; return _collection[position];
} }
@ -66,13 +65,12 @@ namespace ProjectLiner.CollectionGenericObjects
return i; return i;
} }
} }
throw new CollectionOverflowException(); return -1;
} }
public int Insert(T obj, int position) public int Insert(T obj, int position)
{ {
if (position >= Count || position < 0) return -1;
if (position >= Count || position < 0) throw new PositionOutOfCollectionException();
if (_collection[position] == null) if (_collection[position] == null)
{ {
_collection[position] = obj; _collection[position] = obj;
@ -98,16 +96,21 @@ namespace ProjectLiner.CollectionGenericObjects
} }
--temp; --temp;
} }
throw new CollectionOverflowException(); return -1;
} }
public T? Remove(int position) public T? Remove(int position)
{ {
if (position >= Count || position < 0) throw new PositionOutOfCollectionException(); if (position < 0 || position >= Count)
T? myObject = _collection[position]; {
if (myObject == null) throw new ObjectNotFoundException(); return null;
}
//if (_collection[position] == null) return null;
T? temp = _collection[position];
_collection[position] = null; _collection[position] = null;
return myObject; return temp;
} }
public IEnumerable<T?> GetItems() public IEnumerable<T?> GetItems()

View File

@ -1,6 +1,5 @@
using ProjectLiner.CollectionGenericObjects; using ProjectLiner.CollectionGenericObjects;
using ProjectLiner.Drawnings; using ProjectLiner.Drawnings;
using ProjectLiner.Exceptions;
/// <summary> /// <summary>
/// Класс-хранилище коллекций /// Класс-хранилище коллекций
@ -91,10 +90,10 @@ public class StorageCollection<T>
/// </summary> /// </summary>
/// <param name="filename">Путь и имя файла</param> /// <param name="filename">Путь и имя файла</param>
/// <returns>true - сохранение прошло успешно, false - ошибка при сохранении данных</returns> /// <returns>true - сохранение прошло успешно, false - ошибка при сохранении данных</returns>
public void SaveData(string filename) public bool SaveData(string filename)
{ {
if (_storages.Count == 0) if (_storages.Count == 0)
throw new Exception("В хранилище отсутствуют коллекции для сохранения"); return false;
if (File.Exists(filename)) if (File.Exists(filename))
File.Delete(filename); File.Delete(filename);
@ -129,6 +128,7 @@ public class StorageCollection<T>
sw.Write(_separatorItems); sw.Write(_separatorItems);
} }
} }
return true;
} }
/// <summary> /// <summary>
@ -136,24 +136,26 @@ public class StorageCollection<T>
/// </summary> /// </summary>
/// <param name="filename">Путь и имя файла</param> /// <param name="filename">Путь и имя файла</param>
/// <returns>true - загрузка прошла успешно, false - ошибка при загрузке данных</returns> /// <returns>true - загрузка прошла успешно, false - ошибка при загрузке данных</returns>
public void LoadData(string filename) public bool LoadData(string filename)
{ {
if (!File.Exists(filename)) if (!File.Exists(filename))
{ {
throw new FileNotFoundException($"{filename} не существует"); return false;
} }
using (FileStream fs = new(filename, FileMode.Open)) using (FileStream fs = new(filename, FileMode.Open))
{ {
using StreamReader sr = new StreamReader(fs); using StreamReader sr = new StreamReader(fs);
string line = sr.ReadLine();
if (line == null || line.Length == 0) string str = sr.ReadLine();
if (str == null || str.Length == 0)
{ {
throw new Exception("Файл не подходит"); return false;
} }
if (!line.Equals(_collectionKey))
if (!str.Equals(_collectionKey))
{ {
throw new Exception("В файле неверные данные"); return false;
} }
_storages.Clear(); _storages.Clear();
@ -169,7 +171,7 @@ public class StorageCollection<T>
ICollectionGenericObjects<T>? collection = StorageCollection<T>.CreateCollection(collectionType); ICollectionGenericObjects<T>? collection = StorageCollection<T>.CreateCollection(collectionType);
if (collection == null) if (collection == null)
{ {
throw new Exception("Не удалось создать коллекцию"); return false;
} }
collection.MaxCount = Convert.ToInt32(record[2]); collection.MaxCount = Convert.ToInt32(record[2]);
@ -179,22 +181,14 @@ public class StorageCollection<T>
{ {
if (elem?.CreateDrawningCommonLiner() is T commonLiner) if (elem?.CreateDrawningCommonLiner() is T commonLiner)
{ {
try if (collection.Insert(commonLiner) == -1)
{ return false;
if (collection.Insert(commonLiner) == -1)
{
throw new Exception("Объект не удалось добавить в коллекцию: ");
}
}
catch (CollectionOverflowException ex)
{
throw new Exception("Коллекция переполнена", ex);
}
} }
} }
_storages.Add(record[0], collection); _storages.Add(record[0], collection);
} }
} }
return true;
} }
/// <summary> /// <summary>

View File

@ -77,4 +77,5 @@ public class EntityLiner: EntityCommonLiner
Color.FromName(strs[3]), Color.FromName(strs[4]), Color.FromName(strs[3]), Color.FromName(strs[4]),
Convert.ToBoolean(strs[5]), Convert.ToBoolean(strs[6]), Convert.ToBoolean(strs[7])); Convert.ToBoolean(strs[5]), Convert.ToBoolean(strs[6]), Convert.ToBoolean(strs[7]));
} }
} }

View File

@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace ProjectLiner.Exceptions;
/// <summary>
/// Класс, описывающий ошибку переполнения коллекции
/// </summary>
public 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) { }
}

View File

@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace ProjectLiner.Exceptions;
/// <summary>
/// Класс, описывающий ошибку, что по указанной позиции нет элемента
/// </summary>
public 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) { }
}

View File

@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace ProjectLiner.Exceptions;
/// <summary>
/// Класс, описывающий ошибку выхода за границы коллекции
/// </summary>
[Serializable]
public 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) { }
}

View File

@ -75,7 +75,7 @@
// buttonCreateCompany // buttonCreateCompany
// //
buttonCreateCompany.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point); buttonCreateCompany.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point);
buttonCreateCompany.Location = new Point(7, 495); buttonCreateCompany.Location = new Point(8, 520);
buttonCreateCompany.Margin = new Padding(5); buttonCreateCompany.Margin = new Padding(5);
buttonCreateCompany.Name = "buttonCreateCompany"; buttonCreateCompany.Name = "buttonCreateCompany";
buttonCreateCompany.Size = new Size(257, 38); buttonCreateCompany.Size = new Size(257, 38);
@ -96,13 +96,13 @@
panelStorage.Dock = DockStyle.Top; panelStorage.Dock = DockStyle.Top;
panelStorage.Location = new Point(3, 43); panelStorage.Location = new Point(3, 43);
panelStorage.Name = "panelStorage"; panelStorage.Name = "panelStorage";
panelStorage.Size = new Size(266, 370); panelStorage.Size = new Size(266, 405);
panelStorage.TabIndex = 7; panelStorage.TabIndex = 7;
// //
// buttonCollectionDel // buttonCollectionDel
// //
buttonCollectionDel.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point); buttonCollectionDel.Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point);
buttonCollectionDel.Location = new Point(3, 314); buttonCollectionDel.Location = new Point(5, 348);
buttonCollectionDel.Margin = new Padding(5); buttonCollectionDel.Margin = new Padding(5);
buttonCollectionDel.Name = "buttonCollectionDel"; buttonCollectionDel.Name = "buttonCollectionDel";
buttonCollectionDel.Size = new Size(257, 38); buttonCollectionDel.Size = new Size(257, 38);
@ -180,7 +180,7 @@
comboBoxSelectorCompany.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxSelectorCompany.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxSelectorCompany.FormattingEnabled = true; comboBoxSelectorCompany.FormattingEnabled = true;
comboBoxSelectorCompany.Items.AddRange(new object[] { "Хранилище" }); comboBoxSelectorCompany.Items.AddRange(new object[] { "Хранилище" });
comboBoxSelectorCompany.Location = new Point(23, 419); comboBoxSelectorCompany.Location = new Point(20, 458);
comboBoxSelectorCompany.Name = "comboBoxSelectorCompany"; comboBoxSelectorCompany.Name = "comboBoxSelectorCompany";
comboBoxSelectorCompany.Size = new Size(242, 49); comboBoxSelectorCompany.Size = new Size(242, 49);
comboBoxSelectorCompany.TabIndex = 0; comboBoxSelectorCompany.TabIndex = 0;

View File

@ -1,8 +1,6 @@
 
using Microsoft.Extensions.Logging;
using ProjectLiner.CollectionGenericObjects; using ProjectLiner.CollectionGenericObjects;
using ProjectLiner.Drawnings; using ProjectLiner.Drawnings;
using ProjectLiner.Exceptions;
using System.Windows.Forms; using System.Windows.Forms;
namespace ProjectLiner; namespace ProjectLiner;
@ -20,17 +18,12 @@ public partial class FormLinerCollection : Form
/// </summary> /// </summary>
private AbstractCompany? _company = null; private AbstractCompany? _company = null;
/// <summary> /// <summary>
/// Логгер
/// </summary>
private readonly ILogger _logger;
/// <summary>
/// Конструктор /// Конструктор
/// </summary> /// </summary>
public FormLinerCollection(ILogger<FormLinerCollection> logger) public FormLinerCollection()
{ {
InitializeComponent(); InitializeComponent();
_storageCollection = new(); _storageCollection = new();
_logger = logger;
} }
/// <summary> /// <summary>
/// Выбор компании /// Выбор компании
@ -59,23 +52,19 @@ public partial class FormLinerCollection : Form
/// <param name="airplane"></param> /// <param name="airplane"></param>
private void SetLiner(DrawningCommonLiner liner) private void SetLiner(DrawningCommonLiner liner)
{ {
try if (_company == null || liner == null)
{ {
if (_company == null || liner == null) return;
{
return;
}
if (_company + liner != -1)
{
MessageBox.Show("Объект добавлен");
pictureBox.Image = _company.Show();
_logger.LogInformation("Добавлен объект: " + liner.GetDataForSave());
}
} }
catch (CollectionOverflowException ex)
if (_company + liner != -1)
{ {
MessageBox.Show(ex.Message, "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Объект добавлен");
_logger.LogError("Ошибка: {Message}", ex.Message); pictureBox.Image = _company.Show();
}
else
{
MessageBox.Show("Не удалось добавить объект");
} }
} }
@ -86,43 +75,26 @@ public partial class FormLinerCollection : Form
/// <param name="e"></param> /// <param name="e"></param>
private void ButtonRemoveLiner_Click(object sender, EventArgs e) private void ButtonRemoveLiner_Click(object sender, EventArgs e)
{ {
if (string.IsNullOrEmpty(maskedTextBox1.Text) || _company == null) if (string.IsNullOrEmpty(maskedTextBoxPosition?.Text) || _company == null)
{ {
return; return;
} }
if (MessageBox.Show("Удалить объект?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) if (MessageBox.Show("Удалить объект?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
{ {
return; return;
} }
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
if (_company - pos != null)
{
MessageBox.Show("Объект удален");
pictureBox.Image = _company.Show();
}
else
{
MessageBox.Show("Не удалось удалить объект");
}
try
{
int pos = Convert.ToInt32(maskedTextBox1.Text);
if (_company - pos != null)
{
MessageBox.Show("Объект удален");
pictureBox.Image = _company.Show();
_logger.LogInformation("Удаление объекта по индексу " + pos);
}
else
{
MessageBox.Show("Не удалось удалить объект");
_logger.LogInformation("Не удалось удалить объект из коллекции по индексу " + pos);
}
}
catch (ObjectNotFoundException ex)
{
MessageBox.Show(ex.Message);
_logger.LogError("Ошибка: {Message}", ex.Message);
}
catch (PositionOutOfCollectionException ex)
{
MessageBox.Show(ex.Message);
_logger.LogError("Ошибка: {Message}", ex.Message);
}
} }
/// <summary> /// <summary>
/// Передача объекта в другую форму /// Передача объекта в другую форму
/// </summary> /// </summary>
@ -140,19 +112,14 @@ public partial class FormLinerCollection : Form
{ {
liner = _company.GetRandomObject(); liner = _company.GetRandomObject();
counter--; counter--;
if (counter <= 0) if (counter <= 0) break;
{
break;
}
} }
if (liner == null) if (liner == null)
{ {
return; return;
} }
FormLiner form = new() FormLiner form = new FormLiner();
{ form.SetLiner = liner;
SetLiner = liner
};
form.ShowDialog(); form.ShowDialog();
} }
/// <summary> /// <summary>
@ -180,7 +147,6 @@ public partial class FormLinerCollection : Form
if (string.IsNullOrEmpty(textBoxCollectionName.Text) || (!radioButtonList.Checked && !radioButtonMassive.Checked)) if (string.IsNullOrEmpty(textBoxCollectionName.Text) || (!radioButtonList.Checked && !radioButtonMassive.Checked))
{ {
MessageBox.Show("Не все данные заполнены", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Не все данные заполнены", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
_logger.LogInformation("Не удалось добавить коллекцию: не все данные заполнены");
return; return;
} }
CollectionType collectionType = CollectionType.None; CollectionType collectionType = CollectionType.None;
@ -194,7 +160,6 @@ public partial class FormLinerCollection : Form
} }
_storageCollection.AddCollection(textBoxCollectionName.Text, collectionType); _storageCollection.AddCollection(textBoxCollectionName.Text, collectionType);
RerfreshListBoxItems(); RerfreshListBoxItems();
_logger.LogInformation("Добавлена коллекция типа " + collectionType + " с названием " + textBoxCollectionName.Text);
} }
/// <summary> /// <summary>
/// Удаление коллекции /// Удаление коллекции
@ -213,7 +178,6 @@ public partial class FormLinerCollection : Form
return; return;
} }
_storageCollection.DelCollection(listBoxCollection.SelectedItem.ToString()); _storageCollection.DelCollection(listBoxCollection.SelectedItem.ToString());
_logger.LogInformation("Удаление коллекции с названием {name}", listBoxCollection.SelectedItem.ToString());
RerfreshListBoxItems(); RerfreshListBoxItems();
} }
/// <summary> /// <summary>
@ -269,16 +233,13 @@ public partial class FormLinerCollection : Form
{ {
if (saveFileDialog.ShowDialog() == DialogResult.OK) if (saveFileDialog.ShowDialog() == DialogResult.OK)
{ {
try if (_storageCollection.SaveData(saveFileDialog.FileName))
{ {
_storageCollection.SaveData(saveFileDialog.FileName);
MessageBox.Show("Сохранение прошло успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show("Сохранение прошло успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
_logger.LogInformation("Сохранение в файл: {filename}", saveFileDialog.FileName);
} }
catch (Exception ex) else
{ {
MessageBox.Show(ex.Message, "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Не сохранилось", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error);
_logger.LogError("Ошибка: {Message}", ex.Message);
} }
} }
} }
@ -292,21 +253,14 @@ public partial class FormLinerCollection : Form
{ {
if (openFileDialog.ShowDialog() == DialogResult.OK) if (openFileDialog.ShowDialog() == DialogResult.OK)
{ {
try if (_storageCollection.LoadData(openFileDialog.FileName))
{ {
_storageCollection.LoadData(openFileDialog.FileName);
MessageBox.Show("Загрузка прошла успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show("Загрузка прошла успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
foreach (var collection in _storageCollection.Keys)
{
listBoxCollection.Items.Add(collection);
}
RerfreshListBoxItems(); RerfreshListBoxItems();
_logger.LogInformation("Загрузка из файла: {filename}", openFileDialog.FileName);
} }
catch (Exception ex) else
{ {
MessageBox.Show($"Не загрузилось: {ex.Message}", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Не сохранилось", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error);
_logger.LogError("Ошибка: {Message}", ex.Message);
} }
} }
} }

View File

@ -1,8 +1,3 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Serilog;
namespace ProjectLiner namespace ProjectLiner
{ {
internal static class Program internal static class Program
@ -15,36 +10,8 @@ namespace ProjectLiner
{ {
// To customize application configuration such as set high DPI settings or default font, // To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration. // see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize(); ApplicationConfiguration.Initialize();
ServiceCollection services = new(); Application.Run(new FormLinerCollection());
ConfigureServices(services);
using ServiceProvider serviceProvider = services.BuildServiceProvider();
Application.Run(serviceProvider.GetRequiredService<FormLinerCollection>());
}
/// <summary>
/// Êîíôèãóðàöèÿ ñåðâèñà DI
/// </summary>
/// <param name="services"></param>
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<FormLinerCollection>()
.AddLogging(option =>
{
option.SetMinimumLevel(LogLevel.Information);
option.AddSerilog(new LoggerConfiguration()
.ReadFrom.Configuration(new ConfigurationBuilder()
.AddJsonFile($"{pathNeed}serilog.json")
.Build())
.CreateLogger());
});
} }
} }
} }

View File

@ -8,15 +8,6 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.8" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Properties\Resources.Designer.cs"> <Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
@ -32,10 +23,4 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="serilog.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

View File

@ -1,19 +0,0 @@
{
"Serilog": {
"Using": [
"Serilog.Sinks.File"
],
"MinimumLevel": "Debug",
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "log.log"
}
}
],
"Properties": {
"Application": "Sample"
}
}
}