C2016-008: Don’t have ‘Create Missing Enhanced xxx Document Steps’ on context menu if enhanced section does not exist.

This commit is contained in:
Kathy Ruffing 2016-04-14 15:00:57 +00:00
parent e6ad27120c
commit b4c27db531

View File

@ -179,7 +179,19 @@ namespace Volian.Controls.Library
}
if (!itemHasLink)
{
if (inSource && (MyItemInfo.IsHigh || ((MyItemInfo.IsCaution || MyItemInfo.IsNote) && MyItemInfo.MyHLS.GetMyEnhancedDocuments().Count > 0)))
// don't put up 'create missing' if the enhanced procedure does not have a section for this step:
ItemInfo sectInfo = MyItemInfo.ActiveSection;
SectionConfig sectConfig = sectInfo.MyConfig as SectionConfig;
bool hasEnhSect = false;
foreach (EnhancedDocument edsect in sectConfig.MyEnhancedDocuments)
{
if (edsect.Type == edtypebtn)
{
hasEnhSect = true;
break;
}
}
if (inSource && hasEnhSect && (MyItemInfo.IsHigh || ((MyItemInfo.IsCaution || MyItemInfo.IsNote) && MyItemInfo.MyHLS.GetMyEnhancedDocuments().Count > 0)))
{
biEnhanced.Visible = true;
biEnhanced.Text = string.Format("Create Missing Enhanced {0} Document Step", dveds.GetByType(edtypebtn).Name);