20230602
This commit is contained in:
parent
ef329af61a
commit
042a2257bf
@ -1,4 +1,6 @@
|
||||
namespace anbs_cp.Classes;
|
||||
using MimeKit;
|
||||
|
||||
namespace anbs_cp.Classes;
|
||||
|
||||
/// <summary>
|
||||
/// Класс -- расширение для класса File
|
||||
|
51
anbs_cp/Structs/KeyValue.cs
Normal file
51
anbs_cp/Structs/KeyValue.cs
Normal file
@ -0,0 +1,51 @@
|
||||
namespace anbs_cp.Structs;
|
||||
|
||||
/// <summary>
|
||||
/// Пара ключ-значение
|
||||
/// </summary>
|
||||
/// <typeparam name="TK">Тип ключа</typeparam>
|
||||
/// <typeparam name="TV">Тип значения</typeparam>
|
||||
public struct KeyValue<TK, TV>
|
||||
{
|
||||
#region Конструкторы
|
||||
/// <summary>
|
||||
/// Конструктор по умолчанию
|
||||
/// </summary>
|
||||
public KeyValue ()
|
||||
{
|
||||
Key = default;
|
||||
Value = default;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Конструктор со значениями
|
||||
/// </summary>
|
||||
/// <param name="key">Ключ</param>
|
||||
/// <param name="value">Значение</param>
|
||||
public KeyValue (TK key, TV value)
|
||||
{
|
||||
Key = key;
|
||||
Value = value;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Свойства
|
||||
/// <summary>
|
||||
/// Ключ
|
||||
/// </summary>
|
||||
public TK? Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Значение
|
||||
/// </summary>
|
||||
public TV? Value { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Методы
|
||||
/// <summary>
|
||||
/// Получает ключ-значение по умолчанию
|
||||
/// </summary>
|
||||
/// <returns>Ключ-значение по умолчанию</returns>
|
||||
public static KeyValue<TK, TV> GetDefault() => new();
|
||||
#endregion
|
||||
}
|
61
anbs_cp/Structs/TwoDimSize.cs
Normal file
61
anbs_cp/Structs/TwoDimSize.cs
Normal file
@ -0,0 +1,61 @@
|
||||
namespace anbs_cp.Structs;
|
||||
|
||||
/// <summary>
|
||||
/// Двумерный размер
|
||||
/// </summary>
|
||||
public struct TwoDimSize
|
||||
{
|
||||
#region Приватные поля
|
||||
/// <summary>
|
||||
/// Длина (приватное)
|
||||
/// </summary>
|
||||
private int _pWidth;
|
||||
|
||||
/// <summary>
|
||||
/// Высота (приватное)
|
||||
/// </summary>
|
||||
private int _pHeight;
|
||||
#endregion
|
||||
|
||||
#region Конструкторы
|
||||
/// <summary>
|
||||
/// Конструктор по умолчанию
|
||||
/// </summary>
|
||||
public TwoDimSize ()
|
||||
{
|
||||
Width = 0;
|
||||
Height = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Конструктор
|
||||
/// </summary>
|
||||
/// <param name="width">Длина</param>
|
||||
/// <param name="height">Высота</param>
|
||||
public TwoDimSize (int width, int height)
|
||||
{
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Свойства
|
||||
/// <summary>
|
||||
/// Длина
|
||||
/// </summary>
|
||||
public int Width
|
||||
{
|
||||
readonly get => _pWidth;
|
||||
set => _pWidth = value < 0 ? 0 : value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Высота
|
||||
/// </summary>
|
||||
public int Height
|
||||
{
|
||||
readonly get => _pHeight;
|
||||
set => _pHeight = value < 0 ? 0 : value;
|
||||
}
|
||||
#endregion
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Version>2023.0514.2</Version>
|
||||
<Version>2023.0602</Version>
|
||||
<Authors>Александр Бабаев</Authors>
|
||||
<Product>Набор компонентов ANB Software</Product>
|
||||
<Description>Библиотека полезных методов языка C#</Description>
|
||||
@ -38,13 +38,9 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="gfoidl.Base64" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="17.5.33428.366" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="17.6.36389" />
|
||||
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.1" />
|
||||
<PackageReference Include="MimeTypes" Version="2.4.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Text.Encodings.Web" Version="7.0.0" />
|
||||
<PackageReference Include="MimeKit" Version="4.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user