PIbd-12 Shurygin D.I. LabWork07 Simple #8

Closed
ShuryginDima wants to merge 2 commits from LabWork07 into LabWork06
4 changed files with 4 additions and 25 deletions
Showing only changes of commit b647c5bf83 - Show all commits

View File

@ -70,7 +70,7 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
public int Insert(T obj, int position)
{
if (position < 0 || position >= Count)
if (position < 0)
{
return -1;
}
@ -103,7 +103,7 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
{
try
{
T obj = _collection[position];
T? obj = _collection[position];
if (obj == null) throw new ObjectNotFoundException(position);
_collection[position] = null;
return obj;

View File

@ -78,7 +78,7 @@ public partial class FormPlaneCollection : Form
}
catch (Exception ex)
{
MessageBox.Show("Объект не был добавлен");
MessageBox.Show(ex.Message);
_logger.LogError("Ошибка: {Message}", ex.Message);
}
}
@ -110,7 +110,7 @@ public partial class FormPlaneCollection : Form
}
catch (Exception ex)
{
MessageBox.Show("Не удалось удалить объект");
MessageBox.Show(ex.Message);
_logger.LogError("Ошибка: {Message}", ex.Message);
}

View File

@ -35,10 +35,4 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="nlog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true" internalLogLevel="Info">
<targets>
<target xsi:type="File" name="tofile" fileName="carlog-${shortdate}.log" />
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="tofile" />
</rules>
</nlog>
</configuration>