Compare commits

..

No commits in common. "31570fb993e170e8f4ef9af0790f3289c0a5148f" and "cdaae7bc7d78dbf9313c33ce1d8920515bcd9892" have entirely different histories.

7 changed files with 91 additions and 261 deletions

View File

@ -1,6 +1,4 @@

using ProjectAirplaneWithRadar.Exceptions;
namespace ProjectAirplaneWithRadar.CollectionGenericObjects
{
/// <summary>
@ -50,7 +48,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
public T? Get(int position)
{
if (position >= Count || position < 0)
throw new PositionOutOfCollectionException(position);
return null;
return _collection[position];
}
@ -58,8 +56,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
public int Insert(T obj)
{
if (Count + 1 > _maxCount)
throw new CollectionOverflowException(Count);
return -1;
_collection.Add(obj);
return Count;
}
@ -67,11 +64,9 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
public int Insert(T obj, int position)
{
if (Count + 1 > _maxCount)
throw new CollectionOverflowException(Count);
return -1;
if (position < 0 || position > Count)
throw new PositionOutOfCollectionException(position);
return -1;
_collection.Insert(position, obj);
return 1;
}
@ -79,7 +74,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
public T? Remove(int position)
{
if (position < 0 || position > Count)
throw new PositionOutOfCollectionException(position);
return null;
T? temp = _collection[position];
_collection.RemoveAt(position);

View File

@ -1,6 +1,4 @@

using ProjectAirplaneWithRadar.Exceptions;
namespace ProjectAirplaneWithRadar.CollectionGenericObjects
{
/// <summary>
@ -53,11 +51,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
public T? Get(int position)
{
if (position < 0 || position >= Count)
throw new PositionOutOfCollectionException(position);
if (position >= _collection.Length && _collection[position] == null)
throw new ObjectNotFoundException(position);
return null;
return _collection[position];
}
@ -71,13 +65,13 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
return i;
}
}
throw new CollectionOverflowException(Count);
return -1;
}
public int Insert(T obj, int position)
{
if (position < 0 || position >= Count)
throw new PositionOutOfCollectionException(position);
return -1;
if (_collection[position] == null)
{
@ -106,16 +100,19 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
}
temp--;
}
throw new CollectionOverflowException(Count);
return -1;
}
public T? Remove(int position)
{
if (position < 0 || position >= Count)
throw new PositionOutOfCollectionException(position);
return null;
if (_collection[position] == null)
throw new ObjectNotFoundException(position);
{
return null;
}
T? temp = _collection[position];
_collection[position] = null;

View File

@ -66,11 +66,9 @@
groupBoxTools.Controls.Add(panelStorage);
groupBoxTools.Controls.Add(comboBoxSelectorCompany);
groupBoxTools.Dock = DockStyle.Right;
groupBoxTools.Location = new Point(855, 30);
groupBoxTools.Margin = new Padding(3, 4, 3, 4);
groupBoxTools.Location = new Point(883, 24);
groupBoxTools.Name = "groupBoxTools";
groupBoxTools.Padding = new Padding(3, 4, 3, 4);
groupBoxTools.Size = new Size(235, 779);
groupBoxTools.Size = new Size(206, 583);
groupBoxTools.TabIndex = 0;
groupBoxTools.TabStop = false;
groupBoxTools.Text = "Инструменты";
@ -84,19 +82,17 @@
panelCompanyTools.Controls.Add(buttonGoToCheck);
panelCompanyTools.Dock = DockStyle.Bottom;
panelCompanyTools.Enabled = false;
panelCompanyTools.Location = new Point(3, 526);
panelCompanyTools.Margin = new Padding(3, 4, 3, 4);
panelCompanyTools.Location = new Point(3, 393);
panelCompanyTools.Name = "panelCompanyTools";
panelCompanyTools.Size = new Size(229, 249);
panelCompanyTools.Size = new Size(200, 187);
panelCompanyTools.TabIndex = 8;
//
// buttonAddAirplane
//
buttonAddAirplane.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
buttonAddAirplane.Location = new Point(0, 4);
buttonAddAirplane.Margin = new Padding(3, 4, 3, 4);
buttonAddAirplane.Location = new Point(0, 3);
buttonAddAirplane.Name = "buttonAddAirplane";
buttonAddAirplane.Size = new Size(111, 75);
buttonAddAirplane.Size = new Size(97, 56);
buttonAddAirplane.TabIndex = 1;
buttonAddAirplane.Text = "Добавить самолет";
buttonAddAirplane.UseVisualStyleBackColor = true;
@ -104,21 +100,19 @@
//
// maskedTextBoxPosition
//
maskedTextBoxPosition.Location = new Point(0, 108);
maskedTextBoxPosition.Margin = new Padding(3, 4, 3, 4);
maskedTextBoxPosition.Location = new Point(0, 81);
maskedTextBoxPosition.Mask = "00";
maskedTextBoxPosition.Name = "maskedTextBoxPosition";
maskedTextBoxPosition.Size = new Size(89, 27);
maskedTextBoxPosition.Size = new Size(78, 23);
maskedTextBoxPosition.TabIndex = 3;
maskedTextBoxPosition.ValidatingType = typeof(int);
//
// buttonRefresh
//
buttonRefresh.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
buttonRefresh.Location = new Point(118, 164);
buttonRefresh.Margin = new Padding(3, 4, 3, 4);
buttonRefresh.Location = new Point(103, 123);
buttonRefresh.Name = "buttonRefresh";
buttonRefresh.Size = new Size(111, 75);
buttonRefresh.Size = new Size(97, 56);
buttonRefresh.TabIndex = 6;
buttonRefresh.Text = "Обновить";
buttonRefresh.UseVisualStyleBackColor = true;
@ -127,10 +121,9 @@
// buttonRemoveAirplane
//
buttonRemoveAirplane.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
buttonRemoveAirplane.Location = new Point(118, 93);
buttonRemoveAirplane.Margin = new Padding(3, 4, 3, 4);
buttonRemoveAirplane.Location = new Point(103, 70);
buttonRemoveAirplane.Name = "buttonRemoveAirplane";
buttonRemoveAirplane.Size = new Size(111, 57);
buttonRemoveAirplane.Size = new Size(97, 43);
buttonRemoveAirplane.TabIndex = 4;
buttonRemoveAirplane.Text = "Удалить самолет";
buttonRemoveAirplane.UseVisualStyleBackColor = true;
@ -139,10 +132,9 @@
// buttonGoToCheck
//
buttonGoToCheck.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
buttonGoToCheck.Location = new Point(0, 164);
buttonGoToCheck.Margin = new Padding(3, 4, 3, 4);
buttonGoToCheck.Location = new Point(0, 123);
buttonGoToCheck.Name = "buttonGoToCheck";
buttonGoToCheck.Size = new Size(111, 75);
buttonGoToCheck.Size = new Size(97, 56);
buttonGoToCheck.TabIndex = 5;
buttonGoToCheck.Text = "Передать на тесты";
buttonGoToCheck.UseVisualStyleBackColor = true;
@ -150,10 +142,9 @@
//
// buttonCreateCompany
//
buttonCreateCompany.Location = new Point(7, 407);
buttonCreateCompany.Margin = new Padding(3, 4, 3, 4);
buttonCreateCompany.Location = new Point(6, 305);
buttonCreateCompany.Name = "buttonCreateCompany";
buttonCreateCompany.Size = new Size(222, 31);
buttonCreateCompany.Size = new Size(194, 23);
buttonCreateCompany.TabIndex = 7;
buttonCreateCompany.Text = "Создать компанию";
buttonCreateCompany.UseVisualStyleBackColor = true;
@ -169,18 +160,16 @@
panelStorage.Controls.Add(textBoxCollectionName);
panelStorage.Controls.Add(labelCollectionName);
panelStorage.Dock = DockStyle.Top;
panelStorage.Location = new Point(3, 24);
panelStorage.Margin = new Padding(3, 4, 3, 4);
panelStorage.Location = new Point(3, 19);
panelStorage.Name = "panelStorage";
panelStorage.Size = new Size(229, 335);
panelStorage.Size = new Size(200, 251);
panelStorage.TabIndex = 7;
//
// buttonCollectionDel
//
buttonCollectionDel.Location = new Point(3, 295);
buttonCollectionDel.Margin = new Padding(3, 4, 3, 4);
buttonCollectionDel.Location = new Point(3, 221);
buttonCollectionDel.Name = "buttonCollectionDel";
buttonCollectionDel.Size = new Size(222, 31);
buttonCollectionDel.Size = new Size(194, 23);
buttonCollectionDel.TabIndex = 6;
buttonCollectionDel.Text = "Удалить коллекцию";
buttonCollectionDel.UseVisualStyleBackColor = true;
@ -189,18 +178,17 @@
// listBoxCollection
//
listBoxCollection.FormattingEnabled = true;
listBoxCollection.Location = new Point(3, 161);
listBoxCollection.Margin = new Padding(3, 4, 3, 4);
listBoxCollection.ItemHeight = 15;
listBoxCollection.Location = new Point(3, 121);
listBoxCollection.Name = "listBoxCollection";
listBoxCollection.Size = new Size(221, 124);
listBoxCollection.Size = new Size(194, 94);
listBoxCollection.TabIndex = 5;
//
// buttonCollectionAdd
//
buttonCollectionAdd.Location = new Point(3, 109);
buttonCollectionAdd.Margin = new Padding(3, 4, 3, 4);
buttonCollectionAdd.Location = new Point(3, 82);
buttonCollectionAdd.Name = "buttonCollectionAdd";
buttonCollectionAdd.Size = new Size(222, 31);
buttonCollectionAdd.Size = new Size(194, 23);
buttonCollectionAdd.TabIndex = 4;
buttonCollectionAdd.Text = "Добавить коллекцию";
buttonCollectionAdd.UseVisualStyleBackColor = true;
@ -209,10 +197,9 @@
// radioButtonList
//
radioButtonList.AutoSize = true;
radioButtonList.Location = new Point(121, 76);
radioButtonList.Margin = new Padding(3, 4, 3, 4);
radioButtonList.Location = new Point(106, 57);
radioButtonList.Name = "radioButtonList";
radioButtonList.Size = new Size(80, 24);
radioButtonList.Size = new Size(66, 19);
radioButtonList.TabIndex = 3;
radioButtonList.TabStop = true;
radioButtonList.Text = "Список";
@ -221,10 +208,9 @@
// radioButtonMassive
//
radioButtonMassive.AutoSize = true;
radioButtonMassive.Location = new Point(31, 76);
radioButtonMassive.Margin = new Padding(3, 4, 3, 4);
radioButtonMassive.Location = new Point(27, 57);
radioButtonMassive.Name = "radioButtonMassive";
radioButtonMassive.Size = new Size(82, 24);
radioButtonMassive.Size = new Size(67, 19);
radioButtonMassive.TabIndex = 2;
radioButtonMassive.TabStop = true;
radioButtonMassive.Text = "Массив";
@ -232,18 +218,17 @@
//
// textBoxCollectionName
//
textBoxCollectionName.Location = new Point(3, 37);
textBoxCollectionName.Margin = new Padding(3, 4, 3, 4);
textBoxCollectionName.Location = new Point(3, 28);
textBoxCollectionName.Name = "textBoxCollectionName";
textBoxCollectionName.Size = new Size(221, 27);
textBoxCollectionName.Size = new Size(194, 23);
textBoxCollectionName.TabIndex = 1;
//
// labelCollectionName
//
labelCollectionName.AutoSize = true;
labelCollectionName.Location = new Point(43, 13);
labelCollectionName.Location = new Point(38, 10);
labelCollectionName.Name = "labelCollectionName";
labelCollectionName.Size = new Size(158, 20);
labelCollectionName.Size = new Size(125, 15);
labelCollectionName.TabIndex = 0;
labelCollectionName.Text = "Название коллекции:";
//
@ -253,31 +238,27 @@
comboBoxSelectorCompany.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxSelectorCompany.FormattingEnabled = true;
comboBoxSelectorCompany.Items.AddRange(new object[] { "Хранилище" });
comboBoxSelectorCompany.Location = new Point(7, 368);
comboBoxSelectorCompany.Margin = new Padding(3, 4, 3, 4);
comboBoxSelectorCompany.Location = new Point(6, 276);
comboBoxSelectorCompany.Name = "comboBoxSelectorCompany";
comboBoxSelectorCompany.Size = new Size(221, 28);
comboBoxSelectorCompany.Size = new Size(194, 23);
comboBoxSelectorCompany.TabIndex = 0;
comboBoxSelectorCompany.SelectedIndexChanged += ComboBoxSelectorCompany_SelectedIndexChanged;
//
// pictureBox
//
pictureBox.Dock = DockStyle.Fill;
pictureBox.Location = new Point(0, 30);
pictureBox.Margin = new Padding(3, 4, 3, 4);
pictureBox.Location = new Point(0, 24);
pictureBox.Name = "pictureBox";
pictureBox.Size = new Size(855, 779);
pictureBox.Size = new Size(883, 583);
pictureBox.TabIndex = 1;
pictureBox.TabStop = false;
//
// menuStrip
//
menuStrip.ImageScalingSize = new Size(20, 20);
menuStrip.Items.AddRange(new ToolStripItem[] { файлToolStripMenuItem });
menuStrip.Location = new Point(0, 0);
menuStrip.Name = "menuStrip";
menuStrip.Padding = new Padding(7, 3, 0, 3);
menuStrip.Size = new Size(1090, 30);
menuStrip.Size = new Size(1089, 24);
menuStrip.TabIndex = 2;
menuStrip.Text = "menuStrip";
//
@ -285,14 +266,14 @@
//
файлToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { saveToolStripMenuItem, loadToolStripMenuItem });
файлToolStripMenuItem.Name = айлToolStripMenuItem";
файлToolStripMenuItem.Size = new Size(59, 24);
файлToolStripMenuItem.Size = new Size(48, 20);
файлToolStripMenuItem.Text = "Файл";
//
// saveToolStripMenuItem
//
saveToolStripMenuItem.Name = "saveToolStripMenuItem";
saveToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.S;
saveToolStripMenuItem.Size = new Size(227, 26);
saveToolStripMenuItem.Size = new Size(181, 22);
saveToolStripMenuItem.Text = "Сохранение";
saveToolStripMenuItem.Click += SaveToolStripMenuItem_Click;
//
@ -300,7 +281,7 @@
//
loadToolStripMenuItem.Name = "loadToolStripMenuItem";
loadToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.L;
loadToolStripMenuItem.Size = new Size(227, 26);
loadToolStripMenuItem.Size = new Size(181, 22);
loadToolStripMenuItem.Text = "Загрузка";
loadToolStripMenuItem.Click += LoadToolStripMenuItem_Click;
//
@ -314,14 +295,13 @@
//
// FormAirplaneCollection
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1090, 809);
ClientSize = new Size(1089, 607);
Controls.Add(pictureBox);
Controls.Add(groupBoxTools);
Controls.Add(menuStrip);
MainMenuStrip = menuStrip;
Margin = new Padding(3, 4, 3, 4);
Name = "FormAirplaneCollection";
Text = "Коллекция самолетов";
groupBoxTools.ResumeLayout(false);

View File

@ -1,8 +1,5 @@
using System.Numerics;
using Microsoft.Extensions.Logging;
using ProjectAirplaneWithRadar.CollectionGenericObjects;
using ProjectAirplaneWithRadar.CollectionGenericObjects;
using ProjectAirplaneWithRadar.Drawnings;
using ProjectAirplaneWithRadar.Exceptions;
namespace ProjectAirplaneWithRadar
{
@ -21,20 +18,13 @@ namespace ProjectAirplaneWithRadar
/// </summary>
private AbstractCompany? _company = null;
/// <summary>
/// Логгер
/// </summary>
private readonly ILogger _logger;
/// <summary>
/// Конструктор
/// </summary>
public FormAirplaneCollection(ILogger<FormAirplaneCollection> logger)
public FormAirplaneCollection()
{
InitializeComponent();
_storageCollection = new();
_logger = logger;
_logger.LogInformation("Форма загрузилась");
}
/// <summary>
@ -66,26 +56,18 @@ namespace ProjectAirplaneWithRadar
private void SetAirplane(DrawningAirplane airplane)
{
if (_company == null || airplane == null)
{
return;
}
try
if (_company + airplane != -1)
{
if (_company + airplane != -1)
{
MessageBox.Show("Объект добавлен");
pictureBox.Image = _company.Show();
_logger.LogInformation("Добавлен объект: " + airplane.GetDataForSave());
}
MessageBox.Show("Объект добавлен");
pictureBox.Image = _company.Show();
}
catch (CollectionOverflowException ex)
else
{
MessageBox.Show(ex.Message);
_logger.LogError("Ошибка: {Message}", ex.Message);
}
catch (ObjectNotFoundException ex)
{
MessageBox.Show(ex.Message);
_logger.LogError("Ошибка: {Message}", ex.Message);
MessageBox.Show("Не удалось добавить объект");
}
}
@ -107,23 +89,14 @@ namespace ProjectAirplaneWithRadar
}
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
try
if (_company - pos != null)
{
if (_company - pos != null)
{
MessageBox.Show("Объект удален");
pictureBox.Image = _company.Show();
_logger.LogInformation("Удален объект по позиции " + pos);
}
} catch (PositionOutOfCollectionException ex)
MessageBox.Show("Объект удален");
pictureBox.Image = _company.Show();
}
else
{
MessageBox.Show(ex.Message);
_logger.LogError("Ошибка: {Message}", ex.Message);
} catch (ObjectNotFoundException ex)
{
MessageBox.Show(ex.Message);
_logger.LogError("Ошибка: {Message}", ex.Message);
MessageBox.Show("Не удалось удалить объект");
}
}
@ -143,22 +116,11 @@ namespace ProjectAirplaneWithRadar
int counter = 100;
while (plane == null)
{
try
plane = _company.GetRandomObject();
counter--;
if (counter <= 0)
{
plane = _company.GetRandomObject();
counter--;
if (counter <= 0)
{
break;
}
}
catch (PositionOutOfCollectionException ex)
{
MessageBox.Show(ex.Message);
}
catch (ObjectNotFoundException ex)
{
MessageBox.Show(ex.Message);
break;
}
}
@ -202,34 +164,14 @@ namespace ProjectAirplaneWithRadar
return;
}
//CollectionType collectionType = CollectionType.None;
//if (radioButtonMassive.Checked)
// collectionType = CollectionType.Massive;
//else if (radioButtonList.Checked)
// collectionType = CollectionType.List;
CollectionType collectionType = CollectionType.None;
if (radioButtonMassive.Checked)
collectionType = CollectionType.Massive;
else if (radioButtonList.Checked)
collectionType = CollectionType.List;
//_storageCollection.AddCollection(textBoxCollectionName.Text, collectionType);
//RefreshListBoxItems();
try
{
CollectionType collectionType = CollectionType.None;
if (radioButtonMassive.Checked)
{
collectionType = CollectionType.Massive;
}
else if (radioButtonList.Checked)
{
collectionType = CollectionType.List;
}
_storageCollection.AddCollection(textBoxCollectionName.Text, collectionType);
RefreshListBoxItems();
_logger.LogInformation("Коллекция добавлена " + textBoxCollectionName.Text);
}
catch (Exception ex)
{
_logger.LogError("Ошибка: {Message}", ex.Message);
}
_storageCollection.AddCollection(textBoxCollectionName.Text, collectionType);
RefreshListBoxItems();
}
/// <summary>
@ -244,28 +186,13 @@ namespace ProjectAirplaneWithRadar
MessageBox.Show("Коллекция не выбрана");
return;
}
//if (MessageBox.Show("Удалить коллекцию?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
//{
// return;
//}
//_storageCollection.DelCollection(listBoxCollection.SelectedItem.ToString());
//RefreshListBoxItems();
try
if (MessageBox.Show("Удалить коллекцию?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
if (MessageBox.Show("Удалить коллекцию?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
_storageCollection.DelCollection(listBoxCollection.SelectedItem.ToString());
RefreshListBoxItems();
_logger.LogInformation("Коллекция: " + listBoxCollection.SelectedItem.ToString() + " удалена");
}
catch (Exception ex)
{
_logger.LogError("Ошибка: {Message}", ex.Message);
return;
}
_storageCollection.DelCollection(listBoxCollection.SelectedItem.ToString());
RefreshListBoxItems();
}
/// <summary>
@ -326,12 +253,10 @@ namespace ProjectAirplaneWithRadar
{
_storageCollection.SaveData(saveFileDialog.FileName);
MessageBox.Show("Сохранение прошло успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
_logger.LogInformation("Сохранение в файл: {filename}", saveFileDialog.FileName);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message, "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error);
_logger.LogError("Ошибка: {Message}", ex.Message);
}
}
}
@ -350,12 +275,10 @@ namespace ProjectAirplaneWithRadar
_storageCollection.LoadData(openFileDialog.FileName);
MessageBox.Show("Загрузка прошла успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
RefreshListBoxItems();
_logger.LogInformation("Загрузка из файла: {filename}", openFileDialog.FileName);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message, "Результат", 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 ProjectAirplaneWithRadar
{
internal static class Program
@ -16,33 +11,7 @@ namespace ProjectAirplaneWithRadar
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
ServiceCollection services = new();
ConfigureServices(services);
using ServiceProvider serviceProvider = services.BuildServiceProvider();
Application.Run(serviceProvider.GetRequiredService<FormAirplaneCollection>());
Application.Run(new FormAirplaneCollection());
}
/// <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<FormAirplaneCollection>()
.AddLogging(option =>
{
option.SetMinimumLevel(LogLevel.Information);
option.AddSerilog(new LoggerConfiguration()
.ReadFrom.Configuration(new ConfigurationBuilder().AddJsonFile($"{pathNeed}serilog.json").Build()).CreateLogger());
});
}
}
}

View File

@ -8,19 +8,6 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.10" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
@ -36,10 +23,4 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="serilog.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

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