Fixed bug where status bars not always complete when importing or exporting a procedure in which the last section is a word sections, or when the last section of the last procedure in a set is word section.

This commit is contained in:
John Jenko 2016-05-05 20:11:36 +00:00
parent 0b0ed771ba
commit 34d4c2e5b5

View File

@ -1608,6 +1608,16 @@ namespace VEPROMS
pbExportStep.Maximum = pbExportStep.Value;
if(ii.Sections != null)
pbExportSection.Maximum = ii.Sections.Count;
else
{
pbExportSection.Maximum = 1;
pbExportSection.PerformStep();
pbExportStep.Maximum = 1;
pbExportStep.PerformStep();
lblExportSection.Text = "Sections";
lblExportStep.Text = "Steps";
Application.DoEvents();
}
}
if (ii.IsSection && ii.ActiveParent.IsProcedure)
{
@ -1618,6 +1628,13 @@ namespace VEPROMS
pbExportStep.Maximum = pbExportStep.Value;
if (ii.Steps != null)
pbExportStep.Maximum = ii.Steps.Count;
else
{
pbExportStep.Maximum = 1;
pbExportStep.PerformStep();
lblExportStep.Text = "Word Section Data";
Application.DoEvents();
}
}
if (ii.IsStep && ii.ActiveParent.IsSection && ii.ActiveParent.ActiveParent.IsProcedure)
{
@ -1690,6 +1707,18 @@ namespace VEPROMS
pbExportSection.Value = 0;
pbExportStep.Value = 0;
pbExportSection.Maximum = ii.Sections.Count;
if (ii.Sections != null)
pbExportSection.Maximum = ii.Sections.Count;
else
{
pbExportSection.Maximum = 1;
pbExportSection.PerformStep();
pbExportStep.Maximum = 1;
pbExportStep.PerformStep();
lblExportSection.Text = "Sections";
lblExportStep.Text = "Steps";
Application.DoEvents();
}
}
if (ii.IsSection)
{
@ -1699,6 +1728,13 @@ namespace VEPROMS
pbExportStep.Value = 0;
if (ii.Steps != null)
pbExportStep.Maximum = ii.Steps.Count;
else
{
pbExportStep.Maximum = 1;
pbExportStep.PerformStep();
lblExportStep.Text = "Word Section Data";
Application.DoEvents();
}
}
if (ii.IsStep)
{
@ -2973,6 +3009,11 @@ namespace VEPROMS
case "tables":
AddTables(xn, parentInfo);
break;
case "entry": // this is word section max out the status bar
lblImportStep.Text = "Word Section Data";
pbImportStep.Maximum = 1;
pbImportStep.PerformStep();
break;
default:
break;
}