diff --git a/anbs_cp/CountFormatter.cs b/anbs_cp/CountFormatter.cs
new file mode 100644
index 0000000..f6b608b
--- /dev/null
+++ b/anbs_cp/CountFormatter.cs
@@ -0,0 +1,60 @@
+namespace anbs_cp
+{
+ ///
+ /// Форматирует число элементов в понятную строку
+ ///
+ public class CountFormatter : IValueFormatter
+ {
+ #region Cвойства класса
+ ///
+ /// Имена чисел ( , тысяч, миллионов, миллиардов и триллионов)
+ ///
+ public string[] SizeNames { get; set; } = { "Байт", "Кб", "Мб", "Гб", "Тб" };
+ ///
+ /// Знаков после запятой
+ ///
+ public byte DecimalPlaces { get; set; } = 2;
+ ///
+ /// Максимально байт (далее идут Кбайты)
+ ///
+ public long ByteMax { get; set; } = 1024;
+ ///
+ /// Максимально Кбайт (далее идут Мбайты)
+ ///
+ public long KByteMax { get; set; } = 1048576;
+ ///
+ /// Максимально Мбайт (далее идут Гбайты)
+ ///
+ public long MByteMax { get; set; } = 1073741824;
+ ///
+ /// Максимально Гбайт (далее идут Тбайты)
+ ///
+ public long GByteMax { get; set; } = 1099511627776;
+ #endregion
+
+ #region Реализация интерфейса
+ ///
+ /// Реализация интерфейса
+ ///
+ public string[] ValueNames { get => SizeNames; set => SizeNames = value; }
+ ///
+ /// Реализация интерфейса
+ ///
+ public long[] MaxSizes
+ {
+ get => new long[] { ByteMax, KByteMax, MByteMax, GByteMax };
+ set
+ {
+ ByteMax = value[0];
+ KByteMax = value[1];
+ MByteMax = value[2];
+ GByteMax = value[3];
+ }
+ }
+ ///
+ /// Реализация интерфейса
+ ///
+ public string Format(long value) => (this as IValueFormatter).Format(value);
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/anbs_cp/FileSizeFormatter.cs b/anbs_cp/FileSizeFormatter.cs
index a4cbd33..e8e5537 100644
--- a/anbs_cp/FileSizeFormatter.cs
+++ b/anbs_cp/FileSizeFormatter.cs
@@ -51,6 +51,10 @@
GByteMax = value[3];
}
}
+ ///
+ /// Реализация интерфейса
+ ///
+ public string Format(long value) => (this as IValueFormatter).Format(value);
#endregion
}
}
\ No newline at end of file
diff --git a/anbs_cp/anbs_cp.csproj b/anbs_cp/anbs_cp.csproj
index f7f326e..bc9380c 100644
--- a/anbs_cp/anbs_cp.csproj
+++ b/anbs_cp/anbs_cp.csproj
@@ -1,7 +1,7 @@
- net6.0-windows
+ net6.0
1.20211111.0
Alexander Babaev
ANB Software Components Pack