Use template for inserting steps for Callaway Backgrounds

CALBCK format flag
This commit is contained in:
2013-10-02 10:41:04 +00:00
parent 4b7c3ee5d8
commit 062cf39e53
2 changed files with 73 additions and 18 deletions

View File

@@ -194,6 +194,33 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _TPL, "@TPL");
}
}
private bool _NewTemplateFormat;
public bool NewTemplateFormat
{
get { return _NewTemplateFormat; }
set { _NewTemplateFormat = value; }
}
private Dictionary<int, int> _TopTemplateTypes;
public Dictionary<int, int> TopTemplateTypes
{
get
{
if (_TopTemplateTypes == null)
{
_TopTemplateTypes = new Dictionary<int, int>();
// loop through all of templates to find those that are top level, i.e.
// right below the '0'.
int indx = 0;
while (indx < Templates.Count)
{
// level of 0 starts a new group.
if (Templates[indx].level == 0) TopTemplateTypes[Templates[indx + 1].type] = indx+1;
indx++;
}
}
return _TopTemplateTypes;
}
}
private List<TPlate> _Templates;
public List<TPlate> Templates
{
@@ -201,7 +228,7 @@ namespace VEPROMS.CSLA.Library
{
if (_Templates == null) // Load template class from format's string data.
{
bool oldformat = true;
NewTemplateFormat = false;
// count newlines - which gives number of template records.
int NumTemplates = 0;
int indx = TPL.IndexOf('\n');
@@ -214,7 +241,7 @@ namespace VEPROMS.CSLA.Library
_Templates = new List<TPlate>(NumTemplates);
// for each item, create and add to list
if (TPL.IndexOf(',') > -1) oldformat = false;
if (TPL.IndexOf(',') > -1) NewTemplateFormat = true;
int cnt = 0;
int tmpStrIndxStart = 0;
@@ -231,7 +258,7 @@ namespace VEPROMS.CSLA.Library
int nocol = 0;
int row = 0;
string stmp = null;
if (oldformat)
if (!NewTemplateFormat)
{
string[] tmpOld = tpl.Split(" ".ToCharArray());
level = Convert.ToInt32(tmpOld[0]);
@@ -3669,6 +3696,14 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _UseSmartTemplate, "@UseSmartTemplate");
}
}
private LazyLoad<bool> _UseOldTemplate;
public bool UseOldTemplate
{
get
{
return LazyLoad(ref _UseOldTemplate, "@UseOldTemplate");
}
}
private LazyLoad<bool> _AlwaysUseExtraLines;
public bool AlwaysUseExtraLines
{