Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd442a400d | ||
|
|
9df56cdb4d | ||
|
|
7e4fd641e7 | ||
|
|
d43966d9eb |
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace AirFighter
|
namespace AirFighter
|
||||||
{
|
{
|
||||||
internal abstract class AbstractMap
|
internal abstract class AbstractMap : IEquatable<AbstractMap>
|
||||||
{
|
{
|
||||||
private IDrawingObject _drawningObject = null;
|
private IDrawingObject _drawningObject = null;
|
||||||
protected int[,] _map = null;
|
protected int[,] _map = null;
|
||||||
@@ -194,5 +194,21 @@ namespace AirFighter
|
|||||||
protected abstract void GenerateMap();
|
protected abstract void GenerateMap();
|
||||||
protected abstract void DrawRoadPart(Graphics g, int i, int j);
|
protected abstract void DrawRoadPart(Graphics g, int i, int j);
|
||||||
protected abstract void DrawBarrierPart(Graphics g, int i, int j);
|
protected abstract void DrawBarrierPart(Graphics g, int i, int j);
|
||||||
|
|
||||||
|
public bool Equals(AbstractMap? other)
|
||||||
|
{
|
||||||
|
if (_width != other._width || _height != other._height) return false;
|
||||||
|
if (_size_x != other._size_x || _size_y != other._size_y) return false;
|
||||||
|
|
||||||
|
for(int i = 0; i < _map.GetLength(0); i++)
|
||||||
|
{
|
||||||
|
for(int j = 0; j < _map.GetLength(1); j++)
|
||||||
|
{
|
||||||
|
if(_map[i, j] != other._map[i, j]) return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,19 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Extensions.Hosting" Version="5.0.1" />
|
||||||
|
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
|
||||||
|
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||||
|
<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>
|
||||||
@@ -23,4 +36,10 @@
|
|||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="loggerConfig.json">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
31
AirFighter/AirFighter/AircraftCompareByColor.cs
Normal file
31
AirFighter/AirFighter/AircraftCompareByColor.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace AirFighter
|
||||||
|
{
|
||||||
|
internal class AircraftCompareByColor : IComparer<IDrawingObject>
|
||||||
|
{
|
||||||
|
public int Compare(IDrawingObject? x, IDrawingObject? y)
|
||||||
|
{
|
||||||
|
var xAirFighter = x as DrawingObjectAirFighter;
|
||||||
|
var yAirFighter = y as DrawingObjectAirFighter;
|
||||||
|
|
||||||
|
if (xAirFighter == null && yAirFighter == null) return 0;
|
||||||
|
if (xAirFighter == null) return 1;
|
||||||
|
if (yAirFighter == null) return -1;
|
||||||
|
|
||||||
|
string xColor = xAirFighter.GetAirFighter.AirFighter.BodyColor.Name;
|
||||||
|
string yColor = yAirFighter.GetAirFighter.AirFighter.BodyColor.Name;
|
||||||
|
|
||||||
|
if (xColor != yColor) return xColor.CompareTo(yColor);
|
||||||
|
|
||||||
|
var speedCompare = xAirFighter.GetAirFighter.AirFighter.Speed.CompareTo(yAirFighter.GetAirFighter.AirFighter.Speed);
|
||||||
|
if (speedCompare != 0) return speedCompare;
|
||||||
|
|
||||||
|
return xAirFighter.GetAirFighter.AirFighter.Weight.CompareTo(yAirFighter.GetAirFighter.AirFighter.Weight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
38
AirFighter/AirFighter/AircraftCompareByType.cs
Normal file
38
AirFighter/AirFighter/AircraftCompareByType.cs
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace AirFighter
|
||||||
|
{
|
||||||
|
internal class AircraftCompareByType : IComparer<IDrawingObject>
|
||||||
|
{
|
||||||
|
public int Compare(IDrawingObject? x, IDrawingObject? y)
|
||||||
|
{
|
||||||
|
var xAirFighter = x as DrawingObjectAirFighter;
|
||||||
|
var yAirFighter = y as DrawingObjectAirFighter;
|
||||||
|
|
||||||
|
if (xAirFighter == null && yAirFighter == null) return 0;
|
||||||
|
if (xAirFighter == null) return 1;
|
||||||
|
if (yAirFighter == null) return -1;
|
||||||
|
|
||||||
|
|
||||||
|
if (xAirFighter.GetAirFighter.GetType().Name != yAirFighter.GetAirFighter.GetType().Name)
|
||||||
|
{
|
||||||
|
if (xAirFighter.GetAirFighter.GetType().Name == "DrawingAirFighter")
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var speedCompare = xAirFighter.GetAirFighter.AirFighter.Speed.CompareTo(yAirFighter.GetAirFighter.AirFighter.Speed);
|
||||||
|
if (speedCompare != 0)
|
||||||
|
{
|
||||||
|
return speedCompare;
|
||||||
|
}
|
||||||
|
return xAirFighter.GetAirFighter.AirFighter.Weight.CompareTo(yAirFighter.GetAirFighter.AirFighter.Weight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
AirFighter/AirFighter/AircraftNotFoundException.cs
Normal file
14
AirFighter/AirFighter/AircraftNotFoundException.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
|
namespace AirFighter
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
internal class AircraftNotFoundException : ApplicationException
|
||||||
|
{
|
||||||
|
public AircraftNotFoundException(int i) : base($"Не найден объект по позиции {i}") { }
|
||||||
|
public AircraftNotFoundException() : base() { }
|
||||||
|
public AircraftNotFoundException(string message) : base(message) { }
|
||||||
|
public AircraftNotFoundException(string message, Exception exception) : base(message, exception) { }
|
||||||
|
protected AircraftNotFoundException(SerializationInfo info, StreamingContext contex) : base(info, contex) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,9 @@ namespace AirFighter
|
|||||||
{
|
{
|
||||||
_airFighter = airFighter;
|
_airFighter = airFighter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DrawingAirFighter GetAirFighter => _airFighter;
|
||||||
|
|
||||||
public float Step => _airFighter?.AirFighter?.Step ?? 0;
|
public float Step => _airFighter?.AirFighter?.Step ?? 0;
|
||||||
public (float Left, float Right, float Top, float Bottom)
|
public (float Left, float Right, float Top, float Bottom)
|
||||||
GetCurrentPosition()
|
GetCurrentPosition()
|
||||||
@@ -35,5 +38,35 @@ namespace AirFighter
|
|||||||
public string GetInfo() => _airFighter?.GetDataForSave();
|
public string GetInfo() => _airFighter?.GetDataForSave();
|
||||||
public static IDrawingObject Create(string data) => new DrawingObjectAirFighter(data.CreateDrawingAirFighter());
|
public static IDrawingObject Create(string data) => new DrawingObjectAirFighter(data.CreateDrawingAirFighter());
|
||||||
|
|
||||||
|
public bool Equals(IDrawingObject? other)
|
||||||
|
{
|
||||||
|
var otherObj = other as DrawingObjectAirFighter;
|
||||||
|
if (otherObj == null) return false;
|
||||||
|
|
||||||
|
var airFighter = _airFighter.AirFighter;
|
||||||
|
var otherAirFighter = otherObj._airFighter.AirFighter;
|
||||||
|
|
||||||
|
if (airFighter.Speed != otherAirFighter.Speed) return false;
|
||||||
|
if (airFighter.Weight != otherAirFighter.Weight) return false;
|
||||||
|
if (airFighter.BodyColor != otherAirFighter.BodyColor) return false;
|
||||||
|
|
||||||
|
// TODO доделать проверки в случае продвинутого объекта
|
||||||
|
|
||||||
|
if(airFighter.GetType().Name != otherAirFighter.GetType().Name)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(airFighter.GetType().Name == "EntityAirFighter") return true;
|
||||||
|
|
||||||
|
var modernEntity1 = (EntityModernAirFighter) airFighter;
|
||||||
|
var modernEntity2 = (EntityModernAirFighter) otherAirFighter;
|
||||||
|
|
||||||
|
if (modernEntity1.DopColor.Name != modernEntity2.DopColor.Name) return false;
|
||||||
|
if (modernEntity1.Rockets != modernEntity2.Rockets) return false;
|
||||||
|
if (modernEntity1.DopWings != modernEntity2.DopWings) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
41
AirFighter/AirFighter/FormMapWithSetCars.Designer.cs
generated
41
AirFighter/AirFighter/FormMapWithSetCars.Designer.cs
generated
@@ -51,6 +51,8 @@
|
|||||||
this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
|
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
|
||||||
this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
|
this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
|
||||||
|
this.buttonSortByType = new System.Windows.Forms.Button();
|
||||||
|
this.buttonSortByColor = new System.Windows.Forms.Button();
|
||||||
this.tools.SuspendLayout();
|
this.tools.SuspendLayout();
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
|
||||||
@@ -59,6 +61,8 @@
|
|||||||
//
|
//
|
||||||
// tools
|
// tools
|
||||||
//
|
//
|
||||||
|
this.tools.Controls.Add(this.buttonSortByColor);
|
||||||
|
this.tools.Controls.Add(this.buttonSortByType);
|
||||||
this.tools.Controls.Add(this.groupBox1);
|
this.tools.Controls.Add(this.groupBox1);
|
||||||
this.tools.Controls.Add(this.RightButton);
|
this.tools.Controls.Add(this.RightButton);
|
||||||
this.tools.Controls.Add(this.LeftButton);
|
this.tools.Controls.Add(this.LeftButton);
|
||||||
@@ -194,15 +198,16 @@
|
|||||||
//
|
//
|
||||||
// maskedTextBoxPosition
|
// maskedTextBoxPosition
|
||||||
//
|
//
|
||||||
this.maskedTextBoxPosition.Location = new System.Drawing.Point(24, 392);
|
this.maskedTextBoxPosition.Location = new System.Drawing.Point(24, 449);
|
||||||
this.maskedTextBoxPosition.Mask = "00";
|
this.maskedTextBoxPosition.Mask = "00";
|
||||||
this.maskedTextBoxPosition.Name = "maskedTextBoxPosition";
|
this.maskedTextBoxPosition.Name = "maskedTextBoxPosition";
|
||||||
this.maskedTextBoxPosition.Size = new System.Drawing.Size(196, 27);
|
this.maskedTextBoxPosition.Size = new System.Drawing.Size(196, 27);
|
||||||
this.maskedTextBoxPosition.TabIndex = 5;
|
this.maskedTextBoxPosition.TabIndex = 5;
|
||||||
|
this.maskedTextBoxPosition.MaskInputRejected += new System.Windows.Forms.MaskInputRejectedEventHandler(this.maskedTextBoxPosition_MaskInputRejected);
|
||||||
//
|
//
|
||||||
// buttonRemove
|
// buttonRemove
|
||||||
//
|
//
|
||||||
this.buttonRemove.Location = new System.Drawing.Point(24, 425);
|
this.buttonRemove.Location = new System.Drawing.Point(24, 482);
|
||||||
this.buttonRemove.Name = "buttonRemove";
|
this.buttonRemove.Name = "buttonRemove";
|
||||||
this.buttonRemove.Size = new System.Drawing.Size(196, 29);
|
this.buttonRemove.Size = new System.Drawing.Size(196, 29);
|
||||||
this.buttonRemove.TabIndex = 4;
|
this.buttonRemove.TabIndex = 4;
|
||||||
@@ -212,7 +217,7 @@
|
|||||||
//
|
//
|
||||||
// ButtonShowOnMap
|
// ButtonShowOnMap
|
||||||
//
|
//
|
||||||
this.ButtonShowOnMap.Location = new System.Drawing.Point(24, 520);
|
this.ButtonShowOnMap.Location = new System.Drawing.Point(24, 552);
|
||||||
this.ButtonShowOnMap.Name = "ButtonShowOnMap";
|
this.ButtonShowOnMap.Name = "ButtonShowOnMap";
|
||||||
this.ButtonShowOnMap.Size = new System.Drawing.Size(196, 29);
|
this.ButtonShowOnMap.Size = new System.Drawing.Size(196, 29);
|
||||||
this.ButtonShowOnMap.TabIndex = 3;
|
this.ButtonShowOnMap.TabIndex = 3;
|
||||||
@@ -222,7 +227,7 @@
|
|||||||
//
|
//
|
||||||
// ButtonShowStorage
|
// ButtonShowStorage
|
||||||
//
|
//
|
||||||
this.ButtonShowStorage.Location = new System.Drawing.Point(24, 472);
|
this.ButtonShowStorage.Location = new System.Drawing.Point(24, 517);
|
||||||
this.ButtonShowStorage.Name = "ButtonShowStorage";
|
this.ButtonShowStorage.Name = "ButtonShowStorage";
|
||||||
this.ButtonShowStorage.Size = new System.Drawing.Size(196, 29);
|
this.ButtonShowStorage.Size = new System.Drawing.Size(196, 29);
|
||||||
this.ButtonShowStorage.TabIndex = 2;
|
this.ButtonShowStorage.TabIndex = 2;
|
||||||
@@ -232,7 +237,7 @@
|
|||||||
//
|
//
|
||||||
// buttonAdd
|
// buttonAdd
|
||||||
//
|
//
|
||||||
this.buttonAdd.Location = new System.Drawing.Point(24, 357);
|
this.buttonAdd.Location = new System.Drawing.Point(24, 414);
|
||||||
this.buttonAdd.Name = "buttonAdd";
|
this.buttonAdd.Name = "buttonAdd";
|
||||||
this.buttonAdd.Size = new System.Drawing.Size(196, 29);
|
this.buttonAdd.Size = new System.Drawing.Size(196, 29);
|
||||||
this.buttonAdd.TabIndex = 1;
|
this.buttonAdd.TabIndex = 1;
|
||||||
@@ -272,14 +277,14 @@
|
|||||||
// saveToolStripMenuItem
|
// saveToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
|
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
|
||||||
this.saveToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
this.saveToolStripMenuItem.Size = new System.Drawing.Size(177, 26);
|
||||||
this.saveToolStripMenuItem.Text = "Сохранение";
|
this.saveToolStripMenuItem.Text = "Сохранение";
|
||||||
this.saveToolStripMenuItem.Click += new System.EventHandler(this.SaveToolStripMenuItem_Click);
|
this.saveToolStripMenuItem.Click += new System.EventHandler(this.SaveToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// loadToolStripMenuItem
|
// loadToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.loadToolStripMenuItem.Name = "loadToolStripMenuItem";
|
this.loadToolStripMenuItem.Name = "loadToolStripMenuItem";
|
||||||
this.loadToolStripMenuItem.Size = new System.Drawing.Size(224, 26);
|
this.loadToolStripMenuItem.Size = new System.Drawing.Size(177, 26);
|
||||||
this.loadToolStripMenuItem.Text = "Загрузка";
|
this.loadToolStripMenuItem.Text = "Загрузка";
|
||||||
this.loadToolStripMenuItem.Click += new System.EventHandler(this.LoadToolStripMenuItem_Click);
|
this.loadToolStripMenuItem.Click += new System.EventHandler(this.LoadToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
@@ -291,6 +296,26 @@
|
|||||||
//
|
//
|
||||||
this.saveFileDialog.Filter = "txt file | *.txt";
|
this.saveFileDialog.Filter = "txt file | *.txt";
|
||||||
//
|
//
|
||||||
|
// buttonSortByType
|
||||||
|
//
|
||||||
|
this.buttonSortByType.Location = new System.Drawing.Point(27, 325);
|
||||||
|
this.buttonSortByType.Name = "buttonSortByType";
|
||||||
|
this.buttonSortByType.Size = new System.Drawing.Size(196, 29);
|
||||||
|
this.buttonSortByType.TabIndex = 10;
|
||||||
|
this.buttonSortByType.Text = "Сортировать по типу";
|
||||||
|
this.buttonSortByType.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonSortByType.Click += new System.EventHandler(this.ButtonSortByType_Click);
|
||||||
|
//
|
||||||
|
// buttonSortByColor
|
||||||
|
//
|
||||||
|
this.buttonSortByColor.Location = new System.Drawing.Point(27, 360);
|
||||||
|
this.buttonSortByColor.Name = "buttonSortByColor";
|
||||||
|
this.buttonSortByColor.Size = new System.Drawing.Size(196, 29);
|
||||||
|
this.buttonSortByColor.TabIndex = 11;
|
||||||
|
this.buttonSortByColor.Text = "Сортировать по цвету";
|
||||||
|
this.buttonSortByColor.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonSortByColor.Click += new System.EventHandler(this.ButtonSortByColor_Click);
|
||||||
|
//
|
||||||
// FormMapWithSetCars
|
// FormMapWithSetCars
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||||
@@ -339,5 +364,7 @@
|
|||||||
private ToolStripMenuItem loadToolStripMenuItem;
|
private ToolStripMenuItem loadToolStripMenuItem;
|
||||||
private OpenFileDialog openFileDialog;
|
private OpenFileDialog openFileDialog;
|
||||||
private SaveFileDialog saveFileDialog;
|
private SaveFileDialog saveFileDialog;
|
||||||
|
private Button buttonSortByColor;
|
||||||
|
private Button buttonSortByType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
@@ -24,9 +25,14 @@ namespace AirFighter
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Конструктор
|
/// Конструктор
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public FormMapWithSetCars()
|
|
||||||
|
private readonly ILogger _logger;
|
||||||
|
|
||||||
|
public FormMapWithSetCars(ILogger<FormMapWithSetCars> logger)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
_logger = logger;
|
||||||
|
|
||||||
_mapsCollection = new MapsCollection(pictureBox.Width,
|
_mapsCollection = new MapsCollection(pictureBox.Width,
|
||||||
pictureBox.Height);
|
pictureBox.Height);
|
||||||
comboBoxSelectorMap.Items.Clear();
|
comboBoxSelectorMap.Items.Clear();
|
||||||
@@ -70,6 +76,7 @@ namespace AirFighter
|
|||||||
{
|
{
|
||||||
if (comboBoxSelectorMap.SelectedIndex == -1 || string.IsNullOrEmpty(textBoxNewMapName.Text))
|
if (comboBoxSelectorMap.SelectedIndex == -1 || string.IsNullOrEmpty(textBoxNewMapName.Text))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("При попытке создания карты не все данные заполнены");
|
||||||
MessageBox.Show("Не все данные заполнены", "Ошибка",
|
MessageBox.Show("Не все данные заполнены", "Ошибка",
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
return;
|
return;
|
||||||
@@ -77,15 +84,18 @@ namespace AirFighter
|
|||||||
if (!_mapsDict.ContainsKey(comboBoxSelectorMap.Text))
|
if (!_mapsDict.ContainsKey(comboBoxSelectorMap.Text))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Нет такой карты", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show("Нет такой карты", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
_logger.LogInformation($"Нет карты с названием {comboBoxSelectorMap.Text}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_mapsCollection.AddMap(textBoxNewMapName.Text,
|
_mapsCollection.AddMap(textBoxNewMapName.Text,
|
||||||
_mapsDict[comboBoxSelectorMap.Text]);
|
_mapsDict[comboBoxSelectorMap.Text]);
|
||||||
|
_logger.LogInformation($"Добавлена карта {textBoxNewMapName.Text}");
|
||||||
ReloadMaps();
|
ReloadMaps();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ListBoxMaps_SelectedIndexChanged(object sender, EventArgs e)
|
private void ListBoxMaps_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
_logger?.LogInformation($"Переход на карту {listBoxMaps.SelectedItem?.ToString()}");
|
||||||
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,6 +111,7 @@ namespace AirFighter
|
|||||||
{
|
{
|
||||||
_mapsCollection.DelMap(listBoxMaps.SelectedItem?.ToString() ??
|
_mapsCollection.DelMap(listBoxMaps.SelectedItem?.ToString() ??
|
||||||
string.Empty);
|
string.Empty);
|
||||||
|
_logger.LogInformation($"Удаление карты {listBoxMaps.SelectedItem}");
|
||||||
ReloadMaps();
|
ReloadMaps();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,15 +123,26 @@ namespace AirFighter
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + new DrawingObjectAirFighter(aircraft) != -1)
|
try
|
||||||
{
|
{
|
||||||
MessageBox.Show("Объект добавлен");
|
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + new DrawingObjectAirFighter(aircraft) != -1)
|
||||||
pictureBox.Image =
|
{
|
||||||
_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
MessageBox.Show("Объект добавлен");
|
||||||
}
|
pictureBox.Image =
|
||||||
else
|
_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
||||||
|
_logger.LogInformation("На карту добавлен новый объект");
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Такой объект уже существует");
|
||||||
|
}
|
||||||
|
} catch (StorageOverflowException ex)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Не удалось добавить объект");
|
MessageBox.Show($"Ошибка переполнения: {ex.Message}");
|
||||||
|
_logger.LogWarning($"Ошибка переполнения: {ex.Message}");
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Неизвестная ошибка: {ex.Message}");
|
||||||
|
_logger.LogWarning($"Неизвестная ошибка: {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,16 +173,27 @@ namespace AirFighter
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
|
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
|
||||||
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] - pos != null)
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
MessageBox.Show("Объект удален");
|
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] - pos != null)
|
||||||
pictureBox.Image =
|
{
|
||||||
_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
MessageBox.Show("Объект удален");
|
||||||
|
pictureBox.Image =
|
||||||
|
_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
||||||
|
_logger.LogInformation($"Удален объект на позиции {pos}");
|
||||||
|
}
|
||||||
|
} catch (AircraftNotFoundException ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Ошибка удаления: {ex.Message}");
|
||||||
|
_logger.LogWarning($"Ошибка при удалении объекта на позиции {pos}: {ex.Message}");
|
||||||
}
|
}
|
||||||
else
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Не удалось удалить объект");
|
MessageBox.Show($"Неизвестная ошибка: {ex.Message}");
|
||||||
|
_logger.LogWarning($"Неизвестная ошибка при удалении объекта на позиции {pos}: {ex.Message}");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -176,6 +209,7 @@ namespace AirFighter
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
||||||
|
_logger.LogInformation("Показ хранилища");
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -190,7 +224,29 @@ namespace AirFighter
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pictureBox.Image =_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowOnMap();
|
pictureBox.Image =_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowOnMap();
|
||||||
|
_logger.LogInformation("Просмотр карты");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ButtonSortByType_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (listBoxMaps.SelectedIndex == -1) return;
|
||||||
|
|
||||||
|
_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].Sort(new AircraftCompareByType());
|
||||||
|
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Сортировка по цвету
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void ButtonSortByColor_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (listBoxMaps.SelectedIndex == -1) return;
|
||||||
|
|
||||||
|
_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].Sort(new AircraftCompareByColor());
|
||||||
|
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Перемещение
|
/// Перемещение
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -221,45 +277,45 @@ namespace AirFighter
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].MoveObject(dir);
|
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].MoveObject(dir);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveToolStripMenuItem_Click(object sender, EventArgs e)
|
private void SaveToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
if (saveFileDialog.ShowDialog() != DialogResult.OK) return;
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (_mapsCollection.SaveData(saveFileDialog.FileName))
|
_mapsCollection.SaveData(saveFileDialog.FileName);
|
||||||
{
|
MessageBox.Show("Сохранение прошло успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
MessageBox.Show("Сохранение прошло успешно", "Результат",
|
_logger.LogInformation($"Успешное сохранение в файл {saveFileDialog.FileName}");
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
} catch(Exception ex)
|
||||||
}
|
{
|
||||||
else
|
MessageBox.Show($"Не сохранилось: {ex.Message}", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
{
|
_logger.LogWarning($"Ошибка при сохранении в файл {saveFileDialog.FileName}: {ex.Message}");
|
||||||
MessageBox.Show("Не сохранилось", "Результат",
|
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadToolStripMenuItem_Click(object sender, EventArgs e)
|
private void LoadToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// TODO продумать логику
|
if (openFileDialog.ShowDialog() != DialogResult.OK) return;
|
||||||
|
|
||||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
try
|
||||||
{
|
{
|
||||||
if (_mapsCollection.LoadData(openFileDialog.FileName))
|
_mapsCollection.LoadData(openFileDialog.FileName);
|
||||||
{
|
MessageBox.Show("Загрузка прошла успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
MessageBox.Show("Загрузка прошла успешно", "Результат",
|
_logger.LogInformation($"Успешная загрузка из файла {openFileDialog.FileName}");
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
ReloadMaps();
|
||||||
ReloadMaps();
|
} catch(Exception ex)
|
||||||
}
|
{
|
||||||
else
|
MessageBox.Show($"Не загрузилось: {ex.Message}", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
{
|
_logger.LogWarning($"Ошибка при загрузке из файла {openFileDialog.FileName}: {ex.Message}");
|
||||||
MessageBox.Show("Не загрузилось", "Результат",
|
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void maskedTextBoxPosition_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,4 +66,7 @@
|
|||||||
<metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>319, 17</value>
|
<value>319, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>54</value>
|
||||||
|
</metadata>
|
||||||
</root>
|
</root>
|
||||||
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace AirFighter
|
namespace AirFighter
|
||||||
{
|
{
|
||||||
internal interface IDrawingObject
|
internal interface IDrawingObject : IEquatable<IDrawingObject>
|
||||||
{
|
{
|
||||||
public float Step { get; }
|
public float Step { get; }
|
||||||
void SetObject(int x, int y, int width, int height);
|
void SetObject(int x, int y, int width, int height);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
namespace AirFighter
|
namespace AirFighter
|
||||||
{
|
{
|
||||||
internal class MapWithSetCarsGeneric<T, U>
|
internal class MapWithSetCarsGeneric<T, U>
|
||||||
where T : class, IDrawingObject
|
where T : class, IDrawingObject, IEquatable<T>
|
||||||
where U : AbstractMap
|
where U : AbstractMap
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -151,6 +151,11 @@ namespace AirFighter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Sort(IComparer<T> comparer)
|
||||||
|
{
|
||||||
|
_setCars.SortSet(comparer);
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Метод отрисовки фона
|
/// Метод отрисовки фона
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace AirFighter
|
|||||||
_mapStorages.Remove(name);
|
_mapStorages.Remove(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SaveData(string filename)
|
public void SaveData(string filename)
|
||||||
{
|
{
|
||||||
if (File.Exists(filename))
|
if (File.Exists(filename))
|
||||||
{
|
{
|
||||||
@@ -59,14 +59,13 @@ namespace AirFighter
|
|||||||
fs.Write($"{storage.Key}{separatorDict}{storage.Value.GetData(separatorDict, separatorData)}{Environment.NewLine}");
|
fs.Write($"{storage.Key}{separatorDict}{storage.Value.GetData(separatorDict, separatorData)}{Environment.NewLine}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LoadData(string filename)
|
public void LoadData(string filename)
|
||||||
{
|
{
|
||||||
if (!File.Exists(filename))
|
if (!File.Exists(filename))
|
||||||
{
|
{
|
||||||
return false;
|
throw new FileNotFoundException("Файл не найден");
|
||||||
}
|
}
|
||||||
using (StreamReader fs = new(filename))
|
using (StreamReader fs = new(filename))
|
||||||
{
|
{
|
||||||
@@ -74,7 +73,7 @@ namespace AirFighter
|
|||||||
if (!current.Contains("MapsCollection"))
|
if (!current.Contains("MapsCollection"))
|
||||||
{
|
{
|
||||||
//если нет такой записи, то это не те данные
|
//если нет такой записи, то это не те данные
|
||||||
return false;
|
throw new FileFormatException("Не правильный формат данных");
|
||||||
}
|
}
|
||||||
|
|
||||||
_mapStorages.Clear();
|
_mapStorages.Clear();
|
||||||
@@ -96,8 +95,6 @@ namespace AirFighter
|
|||||||
_mapStorages[elem[0]].LoadData(elem[2].Split(separatorData, StringSplitOptions.RemoveEmptyEntries));
|
_mapStorages[elem[0]].LoadData(elem[2].Split(separatorData, StringSplitOptions.RemoveEmptyEntries));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
namespace AirFighter
|
namespace AirFighter
|
||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
@@ -8,10 +13,30 @@ namespace AirFighter
|
|||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main()
|
static void Main()
|
||||||
{
|
{
|
||||||
// To customize application configuration such as set high DPI settings or default font,
|
|
||||||
// see https://aka.ms/applicationconfiguration.
|
|
||||||
ApplicationConfiguration.Initialize();
|
ApplicationConfiguration.Initialize();
|
||||||
Application.Run(new FormMapWithSetCars());
|
var services = new ServiceCollection();
|
||||||
|
ConfigureServices(services);
|
||||||
|
using (ServiceProvider serviceProvider = services.BuildServiceProvider())
|
||||||
|
{
|
||||||
|
Application.Run(serviceProvider.GetRequiredService<FormMapWithSetCars>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ConfigureServices(ServiceCollection services)
|
||||||
|
{
|
||||||
|
services.AddSingleton<FormMapWithSetCars>()
|
||||||
|
.AddLogging(option =>
|
||||||
|
{
|
||||||
|
var config = new ConfigurationBuilder()
|
||||||
|
.SetBasePath(Directory.GetCurrentDirectory())
|
||||||
|
.AddJsonFile("loggerConfig.json")
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
Log.Logger = new LoggerConfiguration().ReadFrom.Configuration(config).CreateLogger();
|
||||||
|
|
||||||
|
option.SetMinimumLevel(LogLevel.Information);
|
||||||
|
option.AddSerilog();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
namespace AirFighter
|
namespace AirFighter
|
||||||
{
|
{
|
||||||
internal class SetCarsGeneric<T>
|
internal class SetCarsGeneric<T>
|
||||||
where T : class
|
where T : class, IEquatable<T>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Список объектов, которые храним
|
/// Список объектов, которые храним
|
||||||
@@ -29,19 +29,16 @@ namespace AirFighter
|
|||||||
}
|
}
|
||||||
public int Insert(T car)
|
public int Insert(T car)
|
||||||
{
|
{
|
||||||
|
if (_places.Contains(car)) return -1;
|
||||||
// TODO вставка в начало набора
|
// TODO вставка в начало набора
|
||||||
if (_places.Count == _maxCount) return -1;
|
if (_places.Count == _maxCount) throw new StorageOverflowException(_maxCount);
|
||||||
_places.Insert(0, car);
|
_places.Insert(0, car);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
public int Insert(T car, int position)
|
public int Insert(T car, int position)
|
||||||
{
|
{
|
||||||
// TODO проверка позиции
|
if (_places.Contains(car)) return -1;
|
||||||
// TODO проверка, что элемент массива по этой позиции пустой, если нет, то
|
if (_places.Count == _maxCount) throw new StorageOverflowException(_maxCount);
|
||||||
// проверка, что после вставляемого элемента в массиве есть пустой элемент
|
|
||||||
// сдвиг всех объектов, находящихся справа от позиции до первого пустого элемента
|
|
||||||
// TODO вставка по позиции
|
|
||||||
if (_places.Count == _maxCount) return -1;
|
|
||||||
_places.Insert(position, car);
|
_places.Insert(position, car);
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
@@ -52,10 +49,12 @@ namespace AirFighter
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public T Remove(int position)
|
public T Remove(int position)
|
||||||
{
|
{
|
||||||
// TODO проверка позиции
|
if(position >= _maxCount || position >= _places.Count) throw new AircraftNotFoundException(position);
|
||||||
// TODO удаление объекта из массива, присовив элементу массива значение null
|
|
||||||
T res = _places[position];
|
T res = _places[position];
|
||||||
_places.Remove(res);
|
_places.Remove(res);
|
||||||
|
|
||||||
|
if (res == null) throw new AircraftNotFoundException(position);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -82,6 +81,12 @@ namespace AirFighter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SortSet(IComparer<T> comparer)
|
||||||
|
{
|
||||||
|
if (comparer == null) return;
|
||||||
|
_places.Sort(comparer);
|
||||||
|
}
|
||||||
|
|
||||||
public IEnumerable<T> GetCars()
|
public IEnumerable<T> GetCars()
|
||||||
{
|
{
|
||||||
foreach (var car in _places)
|
foreach (var car in _places)
|
||||||
|
|||||||
13
AirFighter/AirFighter/StorageOverflowException.cs
Normal file
13
AirFighter/AirFighter/StorageOverflowException.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System.Runtime.Serialization;
|
||||||
|
namespace AirFighter
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
internal class StorageOverflowException : ApplicationException
|
||||||
|
{
|
||||||
|
public StorageOverflowException(int count) : base($"В наборе превышено допустимое количество: { count}") { }
|
||||||
|
public StorageOverflowException() : base() { }
|
||||||
|
public StorageOverflowException(string message) : base(message) { }
|
||||||
|
public StorageOverflowException(string message, Exception exception) : base(message, exception) { }
|
||||||
|
protected StorageOverflowException(SerializationInfo info, StreamingContext contex) : base(info, contex) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
17
AirFighter/AirFighter/loggerConfig.json
Normal file
17
AirFighter/AirFighter/loggerConfig.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"Serilog": {
|
||||||
|
"Using": [ "Serilog.Sinks.File" ],
|
||||||
|
"MinimumLevel": "Information",
|
||||||
|
"WriteTo": [
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "Logs/log_.log",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"outputTemplate": "{Level:u4}: {Message:lj} [{Timestamp:HH:mm:ss.fff}]{NewLine}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user