B2016-165 – Added function to get an item in list given an index

B2016-165 – fix crash on Section Properties when changing format and new format has less docstyles than newly selected format
This commit is contained in:
2016-07-13 13:05:42 +00:00
parent 0910a2deb5
commit 7bd76400c3
2 changed files with 11 additions and 1 deletions

View File

@@ -434,6 +434,16 @@ namespace VEPROMS.CSLA.Library
public class DocStyleList : vlnIndexedFormatList<DocStyle>
{
public DocStyleList(XmlNodeList xmlNodeList) : base(xmlNodeList, null) { }
public DocStyle GetDocStyleItem(int itmcnt) // get the 'itm'th one from list, starting at '0'
{
int cnt = 0;
foreach (DocStyle ds in this)
{
if (cnt == itmcnt) return ds;
cnt++;
}
return null;
}
}
#endregion
#region Layout