StatusBar update using directive
This commit is contained in:
parent
64240ee46c
commit
28ba91e2d6
@ -1,9 +1,10 @@
|
|||||||
using ExcelDna.Integration;
|
using ExcelDna.Integration;
|
||||||
using Microsoft.Office.Interop.Excel;
|
using Microsoft.Office.Interop.Excel;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace RehauSku.Interface
|
namespace RehauSku.Interface
|
||||||
{
|
{
|
||||||
internal abstract class AbstractBar
|
internal abstract class AbstractBar : IDisposable
|
||||||
{
|
{
|
||||||
protected Application Excel = AddIn.Excel;
|
protected Application Excel = AddIn.Excel;
|
||||||
|
|
||||||
@ -14,5 +15,10 @@ namespace RehauSku.Interface
|
|||||||
{
|
{
|
||||||
AddIn.Excel.StatusBar = false;
|
AddIn.Excel.StatusBar = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
AddIn.Excel.OnTime(DateTime.Now + new TimeSpan(0, 0, 5), "ResetStatusBar");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,11 +21,6 @@
|
|||||||
{
|
{
|
||||||
Excel.StatusBar = $"{Message} Выполнено {percent:#.#} %";
|
Excel.StatusBar = $"{Message} Выполнено {percent:#.#} %";
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Excel.StatusBar = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,6 @@ namespace RehauSku.Interface
|
|||||||
}
|
}
|
||||||
|
|
||||||
Excel.StatusBar = sb.ToString();
|
Excel.StatusBar = sb.ToString();
|
||||||
AddIn.Excel.OnTime(DateTime.Now + new TimeSpan(0, 0, 5), "ResetStatusBar");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,28 +28,29 @@ namespace RehauSku.PriceListTools
|
|||||||
|
|
||||||
public override void FillTarget()
|
public override void FillTarget()
|
||||||
{
|
{
|
||||||
ProgressBar = new ProgressBar("Заполняю строки...", SourceFiles.Sum(file => file.PositionAmount.Count));
|
using (ProgressBar = new ProgressBar("Заполняю строки...", SourceFiles.Sum(file => file.PositionAmount.Count)))
|
||||||
ResultBar = new ResultBar();
|
using (ResultBar = new ResultBar())
|
||||||
|
|
||||||
foreach (SourcePriceList source in SourceFiles)
|
|
||||||
{
|
{
|
||||||
TargetFile.Sheet.Columns[TargetFile.AmountCell.Column]
|
foreach (SourcePriceList source in SourceFiles)
|
||||||
.EntireColumn
|
|
||||||
.Insert(XlInsertShiftDirection.xlShiftToRight, XlInsertFormatOrigin.xlFormatFromRightOrBelow);
|
|
||||||
|
|
||||||
Range newColumnHeader = TargetFile.Sheet.Cells[TargetFile.AmountCell.Row, TargetFile.AmountCell.Column - 1];
|
|
||||||
newColumnHeader.Value2 = $"{source.Name}";
|
|
||||||
newColumnHeader.WrapText = true;
|
|
||||||
|
|
||||||
foreach (var kvp in source.PositionAmount)
|
|
||||||
{
|
{
|
||||||
FillPositionAmountToColumns(kvp, TargetFile.AmountCell.Column - 1, TargetFile.AmountCell.Column);
|
TargetFile.Sheet.Columns[TargetFile.AmountCell.Column]
|
||||||
ProgressBar.Update();
|
.EntireColumn
|
||||||
}
|
.Insert(XlInsertShiftDirection.xlShiftToRight, XlInsertFormatOrigin.xlFormatFromRightOrBelow);
|
||||||
}
|
|
||||||
|
|
||||||
FilterByAmount();
|
Range newColumnHeader = TargetFile.Sheet.Cells[TargetFile.AmountCell.Row, TargetFile.AmountCell.Column - 1];
|
||||||
ResultBar.Update();
|
newColumnHeader.Value2 = $"{source.Name}";
|
||||||
|
newColumnHeader.WrapText = true;
|
||||||
|
|
||||||
|
foreach (var kvp in source.PositionAmount)
|
||||||
|
{
|
||||||
|
FillPositionAmountToColumns(kvp, TargetFile.AmountCell.Column - 1, TargetFile.AmountCell.Column);
|
||||||
|
ProgressBar.Update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FilterByAmount();
|
||||||
|
ResultBar.Update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,17 +13,18 @@ namespace RehauSku.PriceListTools
|
|||||||
|
|
||||||
public override void FillTarget()
|
public override void FillTarget()
|
||||||
{
|
{
|
||||||
ProgressBar = new ProgressBar("Заполняю строки...", Current.PositionAmount.Count);
|
using (ProgressBar = new ProgressBar("Заполняю строки...", Current.PositionAmount.Count))
|
||||||
ResultBar = new ResultBar();
|
using (ResultBar = new ResultBar())
|
||||||
|
|
||||||
foreach (var kvp in Current.PositionAmount)
|
|
||||||
{
|
{
|
||||||
FillPositionAmountToColumns(kvp, TargetFile.AmountCell.Column);
|
foreach (var kvp in Current.PositionAmount)
|
||||||
ProgressBar.Update();
|
{
|
||||||
}
|
FillPositionAmountToColumns(kvp, TargetFile.AmountCell.Column);
|
||||||
|
ProgressBar.Update();
|
||||||
|
}
|
||||||
|
|
||||||
FilterByAmount();
|
FilterByAmount();
|
||||||
ResultBar.Update();
|
ResultBar.Update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -23,17 +23,18 @@ namespace RehauSku.PriceListTools
|
|||||||
|
|
||||||
public override void FillTarget()
|
public override void FillTarget()
|
||||||
{
|
{
|
||||||
ProgressBar = new ProgressBar("Заполняю строки...", PositionAmount.Count);
|
using (ProgressBar = new ProgressBar("Заполняю строки...", PositionAmount.Count))
|
||||||
ResultBar = new ResultBar();
|
using (ResultBar = new ResultBar())
|
||||||
|
|
||||||
foreach (var kvp in PositionAmount)
|
|
||||||
{
|
{
|
||||||
FillPositionAmountToColumns(kvp, TargetFile.AmountCell.Column);
|
foreach (var kvp in PositionAmount)
|
||||||
ProgressBar.Update();
|
{
|
||||||
}
|
FillPositionAmountToColumns(kvp, TargetFile.AmountCell.Column);
|
||||||
|
ProgressBar.Update();
|
||||||
|
}
|
||||||
|
|
||||||
FilterByAmount();
|
FilterByAmount();
|
||||||
ResultBar.Update();
|
ResultBar.Update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetSelected()
|
private void GetSelected()
|
||||||
|
@ -26,20 +26,21 @@ namespace RehauSku.PriceListTools
|
|||||||
|
|
||||||
public override void FillTarget()
|
public override void FillTarget()
|
||||||
{
|
{
|
||||||
ProgressBar = new ProgressBar("Заполняю строки...", SourceFiles.Sum(x => x.PositionAmount.Count));
|
using (ProgressBar = new ProgressBar("Заполняю строки...", SourceFiles.Sum(x => x.PositionAmount.Count)))
|
||||||
ResultBar = new ResultBar();
|
using (ResultBar = new ResultBar())
|
||||||
|
|
||||||
foreach (SourcePriceList source in SourceFiles)
|
|
||||||
{
|
{
|
||||||
foreach (var kvp in source.PositionAmount)
|
foreach (SourcePriceList source in SourceFiles)
|
||||||
{
|
{
|
||||||
FillPositionAmountToColumns(kvp, TargetFile.AmountCell.Column);
|
foreach (var kvp in source.PositionAmount)
|
||||||
ProgressBar.Update();
|
{
|
||||||
|
FillPositionAmountToColumns(kvp, TargetFile.AmountCell.Column);
|
||||||
|
ProgressBar.Update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FilterByAmount();
|
FilterByAmount();
|
||||||
ResultBar.Update();
|
ResultBar.Update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user