Use ‘DocStyleListActive’ for section types

This commit is contained in:
Kathy Ruffing 2015-07-22 14:50:03 +00:00
parent 96f25e72e4
commit 238c92502f
2 changed files with 23 additions and 7 deletions

View File

@ -174,7 +174,7 @@ namespace VEPROMS
bool isWordSect = true; bool isWordSect = true;
int sectype = (int)sectinfo.MyContent.Type - 10000; int sectype = (int)sectinfo.MyContent.Type - 10000;
PlantFormat pf = sectinfo.ActiveFormat.PlantFormat; PlantFormat pf = sectinfo.ActiveFormat.PlantFormat;
foreach (DocStyle ds in pf.DocStyles.DocStyleList) foreach (DocStyle ds in pf.DocStyles.DocStyleListActive)
{ {
if (ds.Index == sectype) if (ds.Index == sectype)
{ {
@ -505,7 +505,7 @@ namespace VEPROMS
if (pf != opf) if (pf != opf)
{ {
oldDocStyles = new DocStyleList(null); oldDocStyles = new DocStyleList(null);
foreach (DocStyle ds in opf.DocStyles.DocStyleList) foreach (DocStyle ds in opf.DocStyles.DocStyleListActive)
{ {
if (_isStepSection && ds.IsStepSection) if (_isStepSection && ds.IsStepSection)
oldDocStyles.Add(ds); // find only step section types oldDocStyles.Add(ds); // find only step section types
@ -519,7 +519,7 @@ namespace VEPROMS
DocStyleList newDocStyles = new DocStyleList(null); DocStyleList newDocStyles = new DocStyleList(null);
int selindx = -1; int selindx = -1;
foreach (DocStyle nds in pf.DocStyles.DocStyleList) foreach (DocStyle nds in pf.DocStyles.DocStyleListActive)
{ {
if (_isStepSection && nds.IsStepSection) if (_isStepSection && nds.IsStepSection)
newDocStyles.Add(nds); // add only step section types newDocStyles.Add(nds); // add only step section types

View File

@ -28,16 +28,32 @@ namespace VEPROMS.CSLA.Library
{ {
DocStyleList tmp = new DocStyleList(SelectNodes("DocStyle")); DocStyleList tmp = new DocStyleList(SelectNodes("DocStyle"));
DocStyleList retval = new DocStyleList(null); DocStyleList retval = new DocStyleList(null);
foreach (DocStyle ds in tmp) foreach (DocStyle ds in tmp) retval.Add(ds);
{
if (!ds.Inactive) retval.Add(ds);
}
_DocStyleList = retval; _DocStyleList = retval;
} }
return (_DocStyleList); return (_DocStyleList);
} }
set { _DocStyleList = value; } set { _DocStyleList = value; }
} }
private DocStyleList _DocStyleListActive;
public DocStyleList DocStyleListActive
{
get
{
if (_DocStyleListActive == null)
{
DocStyleList tmp = new DocStyleList(SelectNodes("DocStyle"));
DocStyleList retval = new DocStyleList(null);
foreach (DocStyle ds in tmp)
{
if (!ds.Inactive) retval.Add(ds);
}
_DocStyleListActive = retval;
}
return (_DocStyleListActive);
}
set { _DocStyleListActive = value; }
}
public DocStyles(XmlNode xmlNode) : base(xmlNode) { } public DocStyles(XmlNode xmlNode) : base(xmlNode) { }
} }
#endregion #endregion