From f0acfce2f3466a0d3c25e265c0ed610cecc2676d Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 30 Nov 2022 13:36:29 +0300 Subject: [PATCH] 20221130 --- anbs_cp/Classes/ActionError.cs | 63 +++++ anbs_cp/Classes/ActionInfo.cs | 49 ++++ anbs_cp/Classes/ActionState.cs | 299 ++++++++++++++++++++ anbs_cp/Classes/ActionWarning.cs | 49 ++++ anbs_cp/{ => Classes}/CountFormatter.cs | 6 +- anbs_cp/{ => Classes}/FileSizeFormatter.cs | 6 +- anbs_cp/{ => Classes}/IValueFormatter.cs | 4 +- anbs_cp/{ => Classes}/LikeDelphi.cs | 6 +- anbs_cp/{ => Classes}/SimpleMapper.cs | 11 +- anbs_cp/{ => Classes}/TimestampValidator.cs | 14 +- anbs_cp/{ => Classes}/TypeConverter.cs | 4 +- anbs_cp/Interfaces/IActionError.cs | 14 + anbs_cp/Interfaces/IActionInfo.cs | 12 + anbs_cp/Interfaces/IActionStateMessage.cs | 24 ++ anbs_cp/Interfaces/IActionWarning.cs | 12 + anbs_cp/anbs_cp.csproj | 18 +- anbs_cp/anbs_cp.csproj.DotSettings | 2 + demo/CountValueTest.Designer.cs | 2 +- demo/CountValueTest.cs | 4 +- demo/MainMenu.cs | 12 +- demo/SampleMapperTest.Designer.cs | 4 +- demo/SampleMapperTest.cs | 3 +- demo/SampleMapperTest.resx | 5 - demo/demo.csproj | 7 +- 24 files changed, 570 insertions(+), 60 deletions(-) create mode 100644 anbs_cp/Classes/ActionError.cs create mode 100644 anbs_cp/Classes/ActionInfo.cs create mode 100644 anbs_cp/Classes/ActionState.cs create mode 100644 anbs_cp/Classes/ActionWarning.cs rename anbs_cp/{ => Classes}/CountFormatter.cs (84%) rename anbs_cp/{ => Classes}/FileSizeFormatter.cs (90%) rename anbs_cp/{ => Classes}/IValueFormatter.cs (95%) rename anbs_cp/{ => Classes}/LikeDelphi.cs (85%) rename anbs_cp/{ => Classes}/SimpleMapper.cs (95%) rename anbs_cp/{ => Classes}/TimestampValidator.cs (93%) rename anbs_cp/{ => Classes}/TypeConverter.cs (98%) create mode 100644 anbs_cp/Interfaces/IActionError.cs create mode 100644 anbs_cp/Interfaces/IActionInfo.cs create mode 100644 anbs_cp/Interfaces/IActionStateMessage.cs create mode 100644 anbs_cp/Interfaces/IActionWarning.cs create mode 100644 anbs_cp/anbs_cp.csproj.DotSettings diff --git a/anbs_cp/Classes/ActionError.cs b/anbs_cp/Classes/ActionError.cs new file mode 100644 index 0000000..fd6906e --- /dev/null +++ b/anbs_cp/Classes/ActionError.cs @@ -0,0 +1,63 @@ +using anbs_cp.Interfaces; + +namespace anbs_cp.Classes; + +/// +/// Класс ошибки +/// +public sealed class ActionError: IActionError +{ + /// + /// Критичность ошибки: + /// при некритичных ошибках продолжение выполнения операции возможно, + /// а при критичных -- нет + /// + public bool IsCritical { get; init; } + + /// + /// Объект ошибки + /// + public object Object { get; set; } + + /// + /// Сообщение об ошибке + /// + public string Message { get; set; } + + #region Конструкторы + /// + /// Конструктор по умолчанию + /// + public ActionError () + { + IsCritical = true; + Object = "Not Implemented"; + Message = "Not Implemented"; + } + + /// + /// Конструктор с 2 параметрами + /// + /// Сообщение + /// Критичность ошибки + public ActionError (string message, bool isCritical = true) + { + IsCritical = isCritical; + Object = ""; + Message = message; + } + + /// + /// Конструктор с 3 параметрами + /// + /// Объект ошибки + /// Сообщение + /// Критичность ошибки + public ActionError (object eObject, string message, bool isCritical = true) + { + IsCritical = isCritical; + Object = eObject; + Message = message; + } + #endregion +} \ No newline at end of file diff --git a/anbs_cp/Classes/ActionInfo.cs b/anbs_cp/Classes/ActionInfo.cs new file mode 100644 index 0000000..e2acadf --- /dev/null +++ b/anbs_cp/Classes/ActionInfo.cs @@ -0,0 +1,49 @@ +using anbs_cp.Interfaces; + +namespace anbs_cp.Classes; + +/// +/// Класс предупреждения +/// +public sealed class ActionInfo: IActionInfo +{ + #region Конструкторы + /// + /// Конструктор по умолчанию + /// + public ActionInfo () + { + IsStatusInfo = false; + Object = string.Empty; + Message = string.Empty; + } + + /// + /// Конструктор + /// + /// Объект + /// Сообщение + /// Является статусной информацией? + public ActionInfo (string eObject, string message, bool isStatus = false) + { + IsStatusInfo = isStatus; + Object = eObject; + Message = message; + } + #endregion + + #region Реализация интерфейса + /// + /// Объект + /// + public object Object { get; set; } + /// + /// Сообщение + /// + public string Message { get; set; } + /// + /// Статусная информация (например, начало работы) + /// + public bool IsStatusInfo { get; init; } + #endregion +} \ No newline at end of file diff --git a/anbs_cp/Classes/ActionState.cs b/anbs_cp/Classes/ActionState.cs new file mode 100644 index 0000000..f8b5401 --- /dev/null +++ b/anbs_cp/Classes/ActionState.cs @@ -0,0 +1,299 @@ +using anbs_cp.Interfaces; + +namespace anbs_cp.Classes; + +/// +/// Состояние действия +/// +public sealed class ActionState +{ + /// + /// Конструктор + /// + public ActionState () + { + Info = new(); + Warnings = new(); + Errors = new(); + } + + /// + /// Список информации + /// + public List Info { get; } + + /// + /// Список предупреждений + /// + public List Warnings { get; } + + /// + /// Список ошибок + /// + public List Errors { get; } + + #region Методы + + #region Очистка + /// + /// Очищает список ошибок + /// + public void ClearErrors () + { + Errors.Clear(); + Errors.TrimExcess(); + } + + /// + /// Очищает список предупреждений + /// + public void ClearWarnings () + { + Warnings.Clear(); + Warnings.TrimExcess(); + } + + /// + /// Очищает список информации + /// + public void ClearInfo () + { + Info.Clear(); + Info.TrimExcess(); + } + + /// + /// Очищает все списки + /// + public void Clear () + { + ClearInfo(); + ClearWarnings(); + ClearErrors(); + } + #endregion + + #region Добавление ошибки + /// + /// Добавление ошибки + /// + /// Ошибка + // ReSharper disable once MemberCanBeMadeStatic.Global + // ReSharper disable once FunctionRecursiveOnAllPaths + public void AddError (IActionError error) => AddError(error); + + /// + /// Добавляет ошибки в список + /// + /// Список ошибок + public void AddErrors(IEnumerable errors) => Errors.AddRange(errors); + + /// + /// Добавление ошибки + /// + /// Является ли ошибка критической + public void AddError (bool critical = true) + { + //Создаю ошибку + ActionError error = new("", critical); + + //Добавляю ошибку + AddError(error); + } + + /// + /// Добавление ошибки + /// + /// Сообщение об ошибке + /// Является ли ошибка критической + public void AddError (string message, bool critical = true) + { + //Создаю ошибку + ActionError error = new(message, critical); + + //Добавляю ошибку + AddError(error); + } + + /// + /// Добавление ошибки + /// + /// Объект ошибки + /// Сообщение об ошибке + /// /// Является ли ошибка критической + public void AddError (string errorObject, string message, bool critical = true) + { + //Создаю ошибку + ActionError error = new(errorObject, message, critical); + + //Добавляю ошибку + AddError(error); + } + #endregion + + #region Добавление предупреждения + /// + /// Добавление предупреждения + /// + /// Предупреждение + public void AddWarning (IActionWarning warning) => Warnings.Add(warning); + + /// + /// Добавление предупреждений + /// + /// Список предупреждений + public void AddWarnings(IEnumerable warnings) => Warnings.AddRange(warnings); + + /// + /// Добавление предупреждение + /// + /// Текст предупреждения + /// Объект предупреждения + public void AddWarning (string message, string warningObject = "") + { + //Создаю предупреждение + ActionWarning warning = new(warningObject, message); + + //Добавляю предупреждение + AddWarning(warning); + } + #endregion + + #region Добавление информации + /// + /// Добавление информации + /// + /// Информация + public void AddInfo (IActionInfo info) => Info.Add(info); + + /// + /// Добавление информации + /// + /// Список информации + public void AddInfos (IEnumerable infos) => Info.AddRange(infos); + + /// + /// Добавление информации + /// + /// Текст информации + /// Объект информации + public void AddInfo (string message, string warningObject = "") + { + //Создаю информацию + ActionInfo info = new(warningObject, message); + + //Добавляю информацию + AddInfo(info); + } + #endregion + + #region Печать + /// + /// Печать списка ошибок + /// + /// Формат списка + /// Формат элемента списка + /// Список ошибок в текстовой форме + public string PrintErrorList (string formatList, string formatItem) + { + string elements = +#pragma warning disable CS8625 + Errors.Aggregate(null, (current, error) => current + error.PrintMessage(formatItem)); +#pragma warning restore CS8625 + + return string.Format(formatList, elements); + } + + /// + /// Печать списка предупреждений + /// + /// Формат списка + /// Формат элемента списка + /// Список предупреждений в текстовой форме + public string PrintWarningList (string formatList, string formatItem) + { + string elements = +#pragma warning disable CS8625 + Warnings.Aggregate(null, +#pragma warning restore CS8625 + (current, warning) => current + warning.PrintMessage(formatItem)); + + return string.Format(formatList, elements); + } + + /// + /// Печать списка информации + /// + /// Формат списка + /// Формат элемента списка + /// Список информации в текстовой форме + public string PrintInfoList (string formatList, string formatItem) + { + string elements = +#pragma warning disable CS8625 + Info.Aggregate(null, (current, info) => current + info.PrintMessage(formatItem)); +#pragma warning restore CS8625 + + return string.Format(formatList, elements); + } + #endregion + + #region Проверка на наличие + /// + /// Проверяет, есть ли ошибки + /// + /// Игнорировать не критические + /// Наличие ошибок + public bool HasErrors (bool ignoreNonCritical = false) => + ignoreNonCritical ? Errors.Any(static error => error.IsCritical) : Errors.Any(); + + /// + /// Проверяет, есть ли предупреждения + /// + /// Игнорировать информационные предупреждения + /// Наличие предупреждений + public bool HasWarnings (bool ignoreInformWarning = false) => ignoreInformWarning + ? Warnings.Any(static warning => !warning.IsInformWarning) + : Warnings.Any(); + + /// + /// Проверяет, есть ли сообщения + /// + /// Игнорировать статусные сообщения + /// Наличие сообщений + public bool HasInfo (bool ignoreStatus) => ignoreStatus ? Info.Any(static info => !info.IsStatusInfo) : Info.Any(); + + /// + /// Успешно ли завершилось + /// + public bool IsSuccess (bool ignoreNonCriticalErrors = false) => + !HasErrors(ignoreNonCriticalErrors) && !HasWarnings(true); + #endregion + + #region Количество сообщений + /// + /// Количество ошибок + /// + /// Игнорировать не критические + /// Количество ошибок + public int ErrorsCount (bool ignoreNonCritical = false) => + ignoreNonCritical ? Errors.Count(static error => error.IsCritical) : Errors.Count; + + /// + /// Количество предупреждений + /// + /// Игнорировать информационные предупреждения + /// Количество предупреждений + public int WarningsCount (bool ignoreInformWarning = false) => ignoreInformWarning + ? Warnings.Count(static warning => !warning.IsInformWarning) + : Warnings.Count; + + /// + /// Количество информационных сообщений + /// + /// Игнорировать статусные сообщения + /// Количество информационных сообщений + public int InfoCount (bool ignoreStatus) => ignoreStatus ? Info.Count(static info => !info.IsStatusInfo) : Info.Count; + #endregion + #endregion +} \ No newline at end of file diff --git a/anbs_cp/Classes/ActionWarning.cs b/anbs_cp/Classes/ActionWarning.cs new file mode 100644 index 0000000..e25a6c7 --- /dev/null +++ b/anbs_cp/Classes/ActionWarning.cs @@ -0,0 +1,49 @@ +using anbs_cp.Interfaces; + +namespace anbs_cp.Classes; + +/// +/// Класс предупреждения +/// +public sealed class ActionWarning: IActionWarning +{ + #region Конструкторы + /// + /// Конструктор по умолчанию + /// + public ActionWarning () + { + IsInformWarning = false; + Object = string.Empty; + Message = string.Empty; + } + + /// + /// Конструктор + /// + /// Объект + /// Сообщение + /// Является ли информирующим предупреждением + public ActionWarning (string eObject, string message, bool isInform = false) + { + IsInformWarning = isInform; + Object = eObject; + Message = message; + } + #endregion + + #region Реализация интерфейса + /// + /// Объект + /// + public object Object { get; set; } + /// + /// Сообщение + /// + public string Message { get; set; } + /// + /// Информирующее предупреждение возникает для предупреждения ВОЗМОЖНОЙ ошибки в дальнейшей эксплуатации и не влияет на текущую операцию. + /// + public bool IsInformWarning { get; init; } + #endregion +} \ No newline at end of file diff --git a/anbs_cp/CountFormatter.cs b/anbs_cp/Classes/CountFormatter.cs similarity index 84% rename from anbs_cp/CountFormatter.cs rename to anbs_cp/Classes/CountFormatter.cs index b152fd8..c908651 100644 --- a/anbs_cp/CountFormatter.cs +++ b/anbs_cp/Classes/CountFormatter.cs @@ -1,4 +1,4 @@ -namespace anbs_cp; +namespace anbs_cp.Classes; /// /// Форматирует число элементов в понятную строку @@ -10,7 +10,7 @@ public sealed class CountFormatter : IValueFormatter /// /// Имена чисел (тысяч, миллионов, миллиардов и т.п.) /// - public string[] CountNames { get; set; } = {"", "тыс.", "млн.", "млрд."}; + public string[] CountNames { get; set; } = { "", "тыс.", "млн.", "млрд." }; /// /// Знаков после запятой @@ -20,7 +20,7 @@ public sealed class CountFormatter : IValueFormatter /// /// Делители чисел /// - public long[] Delimeters { get; set; } = {1000, 1000000, 1000000000}; + public long[] Delimeters { get; set; } = { 1000, 1000000, 1000000000 }; #endregion diff --git a/anbs_cp/FileSizeFormatter.cs b/anbs_cp/Classes/FileSizeFormatter.cs similarity index 90% rename from anbs_cp/FileSizeFormatter.cs rename to anbs_cp/Classes/FileSizeFormatter.cs index b2f5efd..1cae56d 100644 --- a/anbs_cp/FileSizeFormatter.cs +++ b/anbs_cp/Classes/FileSizeFormatter.cs @@ -1,4 +1,4 @@ -namespace anbs_cp; +namespace anbs_cp.Classes; /// /// Форматирует размер файла/папки в понятную строку @@ -10,7 +10,7 @@ public class FileSizeFormatter : IValueFormatter /// /// Имена размеров (байт, килобайт, мегабайт, гигабайт и террабайт) /// - public string[] SizeNames { get; set; } = {"Байт", "Кб", "Мб", "Гб", "Тб"}; + public string[] SizeNames { get; set; } = { "Байт", "Кб", "Мб", "Гб", "Тб" }; /// /// Знаков после запятой @@ -55,7 +55,7 @@ public class FileSizeFormatter : IValueFormatter /// public long[] MaxSizes { - get => new[] {ByteMax, KByteMax, MByteMax, GByteMax}; + get => new[] { ByteMax, KByteMax, MByteMax, GByteMax }; set { ByteMax = value[0]; diff --git a/anbs_cp/IValueFormatter.cs b/anbs_cp/Classes/IValueFormatter.cs similarity index 95% rename from anbs_cp/IValueFormatter.cs rename to anbs_cp/Classes/IValueFormatter.cs index a58a225..eb1f2bd 100644 --- a/anbs_cp/IValueFormatter.cs +++ b/anbs_cp/Classes/IValueFormatter.cs @@ -1,4 +1,4 @@ -namespace anbs_cp; +namespace anbs_cp.Classes; /// /// Форматирует размерности в понятную строку @@ -65,7 +65,7 @@ public interface IValueFormatter for (int i = 0; i <= DecimalPlaces; i++) delim *= 10; - decimal value = Math.Round((decimal) (dividend * delim / divider)) / delim; + decimal value = Math.Round((decimal)(dividend * delim / divider)) / delim; return $"{value}"; } diff --git a/anbs_cp/LikeDelphi.cs b/anbs_cp/Classes/LikeDelphi.cs similarity index 85% rename from anbs_cp/LikeDelphi.cs rename to anbs_cp/Classes/LikeDelphi.cs index 07fcfe0..9776f1a 100644 --- a/anbs_cp/LikeDelphi.cs +++ b/anbs_cp/Classes/LikeDelphi.cs @@ -1,4 +1,4 @@ -namespace anbs_cp; +namespace anbs_cp.Classes; /// /// Класс, добавляющий реализацию некоторых методов Delphi, которые упрощают работу в C#. @@ -10,7 +10,7 @@ public static class LikeDelphi /// /// Путь, к которому нужно добавить slash /// Путь со slash в конце - public static string IncludeTrailingBackslash (string path) + public static string IncludeTrailingBackslash(string path) { //По умолчанию сохраняем путь string result = path; @@ -29,5 +29,5 @@ public static class LikeDelphi /// Строка, которую нужно разбить /// Символ-делитель строки /// Массив строк - public static List ParseString (string str, char delimiter) => str.Split (delimiter).ToList(); + public static List ParseString(string str, char delimiter) => str.Split(delimiter).ToList(); } \ No newline at end of file diff --git a/anbs_cp/SimpleMapper.cs b/anbs_cp/Classes/SimpleMapper.cs similarity index 95% rename from anbs_cp/SimpleMapper.cs rename to anbs_cp/Classes/SimpleMapper.cs index f6a19d5..6195d0f 100644 --- a/anbs_cp/SimpleMapper.cs +++ b/anbs_cp/Classes/SimpleMapper.cs @@ -1,6 +1,6 @@ using System.Reflection; -namespace anbs_cp; +namespace anbs_cp.Classes; /// /// Класс перевода одинаковых свойств из класса TF в класс T. @@ -19,7 +19,7 @@ public static class SimpleMapper /// Список параметров для сопоставления /// Класс-родитель /// Класс-приемник - public static void MapEx (TF from, ref T to, MapMode mode, List list) + public static void MapEx(TF from, ref T to, MapMode mode, List list) { //Копирую поля Type typeOfA = typeof(TF); @@ -58,7 +58,7 @@ public static class SimpleMapper /// Класс-родитель /// Класс-приемник /// Элемент класса T - public static T Map (TF from) + public static T Map(TF from) { //Создаю элемент // ReSharper disable once NullableWarningSuppressionIsUsed @@ -77,7 +77,7 @@ public static class SimpleMapper /// Режим проверки /// Список игнорирования/добавления /// - private static bool CheckCondition (string itemName, object? itemValue, MapMode mode, ICollection list) + private static bool CheckCondition(string itemName, object? itemValue, MapMode mode, ICollection list) { //Если режим "Только список" и поля нет в списке, //либо режим "Только не в списке" и поле есть в списке @@ -85,7 +85,8 @@ public static class SimpleMapper //или режим "Только не по умолчанию" и значение по умолчанию //то пропускаем bool result = - mode switch { + mode switch + { MapMode.MapFull => true, MapMode.MapNotNull => itemValue != null, MapMode.MapByList => list.Contains(itemName), diff --git a/anbs_cp/TimestampValidator.cs b/anbs_cp/Classes/TimestampValidator.cs similarity index 93% rename from anbs_cp/TimestampValidator.cs rename to anbs_cp/Classes/TimestampValidator.cs index ebe29bd..910c325 100644 --- a/anbs_cp/TimestampValidator.cs +++ b/anbs_cp/Classes/TimestampValidator.cs @@ -1,4 +1,4 @@ -namespace anbs_cp; +namespace anbs_cp.Classes; /// /// Класс проверки временного интервала @@ -9,14 +9,14 @@ public static class TimestampValidator /// Проверка попадания в заданный интервал (в мс) /// /// Временной интервал - /// Проверяемый временной интервал - /// Временная дельта в миллисекундах + /// Проверяемый временной интервал + /// Временная дельта в миллисекундах /// - /// Попал ли в промежуток + - /// + /// Попал ли в промежуток + + /// /// - public static bool Validate(long timestamp, long checkedstamp, ulong deltams) => - new TimeSpan(timestamp) + TimeSpan.FromMilliseconds(deltams) > new TimeSpan(checkedstamp); + public static bool Validate(long timestamp, long checkedStamp, ulong deltaMs) => + new TimeSpan(timestamp) + TimeSpan.FromMilliseconds(deltaMs) > new TimeSpan(checkedStamp); /// /// Проверка попадания текущего времени в заданный интервал (в мс) diff --git a/anbs_cp/TypeConverter.cs b/anbs_cp/Classes/TypeConverter.cs similarity index 98% rename from anbs_cp/TypeConverter.cs rename to anbs_cp/Classes/TypeConverter.cs index 2f988e7..6139a0f 100644 --- a/anbs_cp/TypeConverter.cs +++ b/anbs_cp/Classes/TypeConverter.cs @@ -1,7 +1,7 @@ using System.Text.Encodings.Web; using Microsoft.AspNetCore.Html; -namespace anbs_cp; +namespace anbs_cp.Classes; /// /// Конвертер типов на манер Delphi @@ -117,7 +117,7 @@ public static class TypeConverter /// /// Значение, которое нужно преобразовать. /// - public static string HtmlContentToString (IHtmlContent content) + public static string HtmlContentToString(IHtmlContent content) { //Создаём writer using StringWriter writer = new(); diff --git a/anbs_cp/Interfaces/IActionError.cs b/anbs_cp/Interfaces/IActionError.cs new file mode 100644 index 0000000..38cf7bb --- /dev/null +++ b/anbs_cp/Interfaces/IActionError.cs @@ -0,0 +1,14 @@ +namespace anbs_cp.Interfaces; + +/// +/// Интерфейс ошибки +/// +public interface IActionError : IActionStateMessage +{ + /// + /// Критичность ошибки: + /// при некритичных ошибках продолжение выполнения операции возможно, + /// а при критичных -- нет + /// + public bool IsCritical { get; init; } +} \ No newline at end of file diff --git a/anbs_cp/Interfaces/IActionInfo.cs b/anbs_cp/Interfaces/IActionInfo.cs new file mode 100644 index 0000000..c48f47c --- /dev/null +++ b/anbs_cp/Interfaces/IActionInfo.cs @@ -0,0 +1,12 @@ +namespace anbs_cp.Interfaces; + +/// +/// Интерфейс для информации по статусу +/// +public interface IActionInfo : IActionStateMessage +{ + /// + /// Статусная информация (например, начало работы) + /// + public bool IsStatusInfo { get; init; } +} \ No newline at end of file diff --git a/anbs_cp/Interfaces/IActionStateMessage.cs b/anbs_cp/Interfaces/IActionStateMessage.cs new file mode 100644 index 0000000..e6af12b --- /dev/null +++ b/anbs_cp/Interfaces/IActionStateMessage.cs @@ -0,0 +1,24 @@ +namespace anbs_cp.Interfaces; + +/// +/// Интерфейс сообщения состояния +/// +public interface IActionStateMessage +{ + /// + /// Объект сообщения + /// + public object Object { get; set; } + + /// + /// Текст сообщения + /// + public string Message { get; set; } + + /// + /// Функция вывода сообщения + /// + /// Строка-форматирование (например, «[{0}] - {1}») + /// Отформатированную строка + public string PrintMessage (string format) => string.Format (format, Object, Message); +} \ No newline at end of file diff --git a/anbs_cp/Interfaces/IActionWarning.cs b/anbs_cp/Interfaces/IActionWarning.cs new file mode 100644 index 0000000..23ec4cc --- /dev/null +++ b/anbs_cp/Interfaces/IActionWarning.cs @@ -0,0 +1,12 @@ +namespace anbs_cp.Interfaces; + +/// +/// Интерфейс предупреждения +/// +public interface IActionWarning : IActionStateMessage +{ + /// + /// Информирующее предупреждение возникает для предупреждения ВОЗМОЖНОЙ ошибки в дальнейшей эксплуатации и не влияет на текущую операцию. + /// + public bool IsInformWarning { get; init; } +} \ No newline at end of file diff --git a/anbs_cp/anbs_cp.csproj b/anbs_cp/anbs_cp.csproj index 95deaa4..3400fff 100644 --- a/anbs_cp/anbs_cp.csproj +++ b/anbs_cp/anbs_cp.csproj @@ -1,8 +1,8 @@ - net6.0 - 1.2022.1028 + net7.0 + 1.2022.1130 Alexander Babaev ANB Software Components Pack Library of some useful functions in C# language. @@ -12,29 +12,31 @@ enable enable True - False + True https://git.babaev-an.ru/babaev-an/anbsoftware_componentspack https://git.babaev-an.ru/babaev-an/anbsoftware_componentspack - 1.2022.1028 - 1.2022.1028 + 1.2022.1130 + 1.2022.1130 ANBSoftware.ComponentsPack MIT 6.0 + git + True - 2 + 7 True - 2 + 7 True - + diff --git a/anbs_cp/anbs_cp.csproj.DotSettings b/anbs_cp/anbs_cp.csproj.DotSettings new file mode 100644 index 0000000..16c7a3d --- /dev/null +++ b/anbs_cp/anbs_cp.csproj.DotSettings @@ -0,0 +1,2 @@ + + CSharp110 \ No newline at end of file diff --git a/demo/CountValueTest.Designer.cs b/demo/CountValueTest.Designer.cs index 5b54914..19fd306 100644 --- a/demo/CountValueTest.Designer.cs +++ b/demo/CountValueTest.Designer.cs @@ -1,6 +1,6 @@ namespace demo; -partial class CountValueTest +sealed partial class CountValueTest { /// /// Required designer variable. diff --git a/demo/CountValueTest.cs b/demo/CountValueTest.cs index e6ad7e5..413373c 100644 --- a/demo/CountValueTest.cs +++ b/demo/CountValueTest.cs @@ -1,8 +1,8 @@ -using anbs_cp; +using anbs_cp.Classes; namespace demo; -public partial class CountValueTest: Form +public sealed partial class CountValueTest: Form { public CountValueTest () { diff --git a/demo/MainMenu.cs b/demo/MainMenu.cs index 1d5505b..cf9b2af 100644 --- a/demo/MainMenu.cs +++ b/demo/MainMenu.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace demo; +namespace demo; public sealed partial class MainMenu: Form { public MainMenu () diff --git a/demo/SampleMapperTest.Designer.cs b/demo/SampleMapperTest.Designer.cs index f1cc47e..8e5fc9f 100644 --- a/demo/SampleMapperTest.Designer.cs +++ b/demo/SampleMapperTest.Designer.cs @@ -88,7 +88,7 @@ sealed partial class SampleMapperTest // ResultArea // this.ResultArea.Dock = System.Windows.Forms.DockStyle.Right; - this.ResultArea.Location = new System.Drawing.Point(811, 0); + this.ResultArea.Location = new System.Drawing.Point(819, 0); this.ResultArea.Multiline = true; this.ResultArea.Name = "ResultArea"; this.ResultArea.ReadOnly = true; @@ -150,7 +150,7 @@ sealed partial class SampleMapperTest // this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1143, 378); + this.ClientSize = new System.Drawing.Size(1151, 378); this.Controls.Add(this.MapModeLabel); this.Controls.Add(this.MapModeEdit); this.Controls.Add(this.DemoDateTimeLabel); diff --git a/demo/SampleMapperTest.cs b/demo/SampleMapperTest.cs index 361f998..cab7845 100644 --- a/demo/SampleMapperTest.cs +++ b/demo/SampleMapperTest.cs @@ -1,5 +1,4 @@ -using anbs_cp; - +using anbs_cp.Classes; using Newtonsoft.Json; namespace demo; diff --git a/demo/SampleMapperTest.resx b/demo/SampleMapperTest.resx index 65463ee..f298a7b 100644 --- a/demo/SampleMapperTest.resx +++ b/demo/SampleMapperTest.resx @@ -57,9 +57,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Demo2 Class before map: -{0} -and after:{1} - \ No newline at end of file diff --git a/demo/demo.csproj b/demo/demo.csproj index 37355f4..ac4ebca 100644 --- a/demo/demo.csproj +++ b/demo/demo.csproj @@ -2,13 +2,12 @@ WinExe - net6.0-windows10.0.22000.0 + net7.0-windows enable true enable Release;Debug.CNF - 7.0 - + demo.Program @@ -20,7 +19,7 @@ - +