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:
parent
0910a2deb5
commit
7bd76400c3
@ -610,7 +610,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
if (oldSelIndx > newDocStyles.Count)
|
if (oldSelIndx > newDocStyles.Count)
|
||||||
{
|
{
|
||||||
string msg = string.Format("The section type that is set is not available in the new format, it was reset to {0}. Verify that it is appropriate.", newDocStyles[0].Name);
|
string msg = string.Format("The section type that is set is not available in the new format, it was reset to '{0}'. Verify that it is appropriate.", newDocStyles.GetDocStyleItem(0).Name);
|
||||||
MessageBox.Show(msg, "Non-existent section");
|
MessageBox.Show(msg, "Non-existent section");
|
||||||
selindx = 0;
|
selindx = 0;
|
||||||
}
|
}
|
||||||
|
@ -434,6 +434,16 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public class DocStyleList : vlnIndexedFormatList<DocStyle>
|
public class DocStyleList : vlnIndexedFormatList<DocStyle>
|
||||||
{
|
{
|
||||||
public DocStyleList(XmlNodeList xmlNodeList) : base(xmlNodeList, null) { }
|
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
|
#endregion
|
||||||
#region Layout
|
#region Layout
|
||||||
|
Loading…
x
Reference in New Issue
Block a user