- Added ShortPath Property to ItemInfo

- Added MacroList
Added CheckOff data
Added CheckOff and ChangeBar
Fixed inheritance
This commit is contained in:
Rich
2010-05-25 16:11:23 +00:00
parent f21a49d75e
commit 8fd6c2eac4
4 changed files with 402 additions and 95 deletions

View File

@@ -1172,6 +1172,22 @@ namespace VEPROMS.CSLA.Library
}
}
}
public string ShortPath
{
get
{
string number = (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : ((DisplayNumber ?? "") == "" ? DisplayText : DisplayNumber));
ItemInfo parent = this;
while (parent.MyPrevious != null) parent = parent.MyPrevious;
if (parent.ItemPartCount == 0)
return number;
else
{
PartInfo partInfo = parent.ItemParts[0];
return partInfo.MyContent.ContentItems.Items[0].ShortPath + "." + ((E_FromType)partInfo.FromType).ToString().Substring(0,1) + number;
}
}
}
public ContentInfo ParentContent
{
get
@@ -1880,6 +1896,49 @@ namespace VEPROMS.CSLA.Library
}
}
#endregion
#region Macro List
[NonSerialized]
protected List<Macro> _MyMacros;
protected bool _MacrosSetup = false;
public List<Macro> MyMacros
{
get
{
if (!_MacrosSetup) SetupMacros();
return _MyMacros;
}
set
{
_MyMacros = value;
}
}
private void SetupMacros()
{
// see if each macro should be printed based on its attributes and the item we're on.
// Attributes to check are NotInRNO, i.e. only add this macro to the result list if
// the item is not in the RNO column. Also, Groupings is used to only have the macro if
// there are N or more of the type in the grouping.
List<Macro> tmp = new List<Macro>();
foreach (Macro macro in ActiveFormat.PlantFormat.FormatData.StepDataList[FormatStepType].TabData.MacroList)
{
bool addToList = true;
if (macro.NotInRNO && IsInRNO) addToList = false;
if (macro.Grouping != null && macro.Grouping > 0)
{
int count = 0;
ItemInfo ii = FirstSibling;
while (ii != null)
{
if (ii.MyContent.Type == MyContent.Type) count++;
ii = ii.NextItem;
}
if (count < macro.Grouping) addToList = false;
}
if (addToList) tmp.Add(macro);
}
if (tmp.Count > 0) _MyMacros = tmp;
}
#endregion
}
#endregion ItemInfo
#region Tab