50 lines
1.1 KiB
C#
50 lines
1.1 KiB
C#
using System.Text;
|
||
#if !NET472
|
||
using System.Runtime.Versioning;
|
||
#endif
|
||
|
||
namespace RhSolutions.Tools;
|
||
|
||
#if !NET472
|
||
[SupportedOSPlatform("windows")]
|
||
#endif
|
||
public class ResultBar : StatusbarBase
|
||
{
|
||
private int Success { get; set; }
|
||
private int Replaced { get; set; }
|
||
private int NotFound { get; set; }
|
||
|
||
public ResultBar()
|
||
{
|
||
Success = 0;
|
||
Replaced = 0;
|
||
NotFound = 0;
|
||
}
|
||
|
||
public void IncrementSuccess() => Success++;
|
||
public void IncrementReplaced() => Replaced++;
|
||
public void IncrementNotFound() => NotFound++;
|
||
|
||
public override void Update()
|
||
{
|
||
StringBuilder sb = new StringBuilder();
|
||
|
||
if (Success > 0)
|
||
{
|
||
sb.Append($"Успешно экспортировано {Success} артикулов. ");
|
||
}
|
||
|
||
if (Replaced > 0)
|
||
{
|
||
sb.Append($"Заменено {Replaced} артикулов. ");
|
||
}
|
||
|
||
if (NotFound > 0)
|
||
{
|
||
sb.Append($"Не найдено {NotFound} артикулов.");
|
||
}
|
||
|
||
Excel.StatusBar = sb.ToString();
|
||
}
|
||
}
|