This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Text.RegularExpressions;
|
||||
using Csla;
|
||||
using Csla.Data;
|
||||
|
||||
@@ -856,6 +857,8 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
string tmpStr = tb.ToString();
|
||||
if (tmpStr.ToUpper().EndsWith(", STEP ")) tb.Remove(tb.Length - 7, 7); // 7 is length of ", Step "
|
||||
else if (tb.Prefix != null && tb.Prefix.StartsWith(")"))
|
||||
tb.Append(")");
|
||||
return true;
|
||||
}
|
||||
string retstr = TranGetSectionNumber(tb._ToItem);
|
||||
@@ -872,10 +875,20 @@ namespace VEPROMS.CSLA.Library
|
||||
tb.ReplaceToken(retstr);
|
||||
return (retstr != null && retstr != "");
|
||||
}
|
||||
private static string FixTitleCase(Match m)
|
||||
{
|
||||
if (Regex.IsMatch(m.Value, @"^[A-Za-z]+\.?$"))
|
||||
{
|
||||
string part1 = m.Value.Substring(0, 1);
|
||||
string part2 = m.Value.Substring(1);
|
||||
return part1.ToUpper() + part2.ToLower();
|
||||
}
|
||||
return m.Value;
|
||||
}
|
||||
private static string CapFirstLetterOnly(string retstr, int p)
|
||||
{
|
||||
string lretstr = retstr;
|
||||
// LATER: write code to capitalize first letter (active plants)
|
||||
string lretstr = Regex.Replace(retstr, @"([^ ,]+)", new MatchEvaluator(FixTitleCase));
|
||||
return lretstr;
|
||||
}
|
||||
// TODO: Section methods are not complete....
|
||||
@@ -897,7 +910,11 @@ namespace VEPROMS.CSLA.Library
|
||||
if (tb._FormatData.TransData.UseSecTitles)
|
||||
{
|
||||
ItemInfo tmpitm = TranGetSectionItem(itminfo);
|
||||
return (tmpitm.MyContent.Text);
|
||||
string sectionTitle = tmpitm.MyContent.Text;
|
||||
sectionTitle = (tb._FormatData.TransData.CapsTransitionsSection ? sectionTitle.ToUpper().Replace(@"\U", @"\u") :
|
||||
tb._FormatData.TransData.Cap1stCharTransSection ? CapFirstLetterOnly(sectionTitle, 0) :
|
||||
sectionTitle);
|
||||
return (sectionTitle);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@@ -4926,6 +4926,14 @@ namespace VEPROMS.CSLA.Library
|
||||
return LazyLoad(ref _CapsTransitions, "@CapsTransitions");
|
||||
}
|
||||
}
|
||||
private LazyLoad<bool> _CapsTransitionsSection;
|
||||
public bool CapsTransitionsSection
|
||||
{
|
||||
get
|
||||
{
|
||||
return LazyLoad(ref _CapsTransitionsSection, "@CapsTransitionsSection");
|
||||
}
|
||||
}
|
||||
private LazyLoad<bool> _CapTranStep;
|
||||
public bool CapTranStep
|
||||
{
|
||||
@@ -4974,6 +4982,14 @@ namespace VEPROMS.CSLA.Library
|
||||
return LazyLoad(ref _Cap1stCharTrans, "@Cap1stCharTrans");
|
||||
}
|
||||
}
|
||||
private LazyLoad<bool> _Cap1stCharTransSection;
|
||||
public bool Cap1stCharTransSection
|
||||
{
|
||||
get
|
||||
{
|
||||
return LazyLoad(ref _Cap1stCharTransSection, "@Cap1stCharTransSection");
|
||||
}
|
||||
}
|
||||
private LazyLoad<bool> _UseTransitionModifier;
|
||||
public bool UseTransitionModifier
|
||||
{
|
||||
|
Reference in New Issue
Block a user