B2017-004 Added a method to check if the current item is inside of a Note or Caution

This commit is contained in:
John Jenko 2017-08-29 15:21:24 +00:00
parent d42425cbc4
commit f45b4e491b
2 changed files with 19 additions and 3 deletions

View File

@ -1579,7 +1579,21 @@ namespace VEPROMS.CSLA.Library
return ((FirstSibling.ItemPartCount > 0) && (FirstSibling.ItemParts[0].PartType == E_FromType.Note));
}
}
// B2017-004 check to see if step part is inside a Caution or Note (used to determin which Table types to include in the change step type list)
public bool IsInCautionOrNote
{
get
{
bool rval = false;
ItemInfo itm = this;
while (itm != null &&!itm.IsHigh && !rval)
{
rval = itm.IsCautionOrNotePart;
if (!rval) itm = itm.MyParent;
}
return rval;
}
}
public bool IsType(string type)
{
if ((int)MyContent.Type < 20000) return false;

View File

@ -632,12 +632,14 @@ namespace VEPROMS.CSLA.Library
{
// if equation type && in single column mode, put out the rnomenu list, and skip the AER items
bool singleColEq = (topType.Type.ToUpper().Contains("EQUATION") && _CurItemInfo.ColumnMode == 0);
// B2017-004 if a Table type && in single column mode or in a Note or Caution, don't list the AER Table option
bool singleColTable = (_CurItemInfo.IsTable && _CurItemInfo.ColumnMode == 0) || _CurItemInfo.IsInCautionOrNote;
if ((singleColEq ||_CurItemInfo.IsInRNO || _CurItemInfo.IsCaution || _CurItemInfo.IsNote) && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "")
sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index)));
else if (!singleColEq)
else if (!singleColEq && !singleColTable)
sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index)));
if (!singleColEq || (singleColEq && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != ""))
if (!singleColTable && (!singleColEq || (singleColEq && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "")))
{
if (topType.Type == curType) retval = cntitm;
cntitm++;