Added a FormattedDisplayText for use on Calvert’s Placekeepers

Will now handle Bold, Underline, and Super/Sub Script
This commit is contained in:
2014-09-18 19:58:04 +00:00
parent 29f3db8605
commit b27b0ad8bd
2 changed files with 69 additions and 7 deletions

View File

@@ -1813,6 +1813,19 @@ namespace VEPROMS.CSLA.Library
return (this.IsProcedure || parent.IsApplicable(apple)) && (cfg.MasterSlave_Applicability.GetFlags().Count == 0 || cfg.MasterSlave_Applicability.GetFlags().Contains(apple));
}
//end jcb added inherited applicability
public string FormattedDisplayText
{
get
{
string str = MyContent.Text;
str = Regex.Replace(str, @"\<[uU]\>", MyDocVersion.DocVersionConfig.Unit_Number);
//if (str.Contains("<u>"))
// str = str.Replace("<u>", MyDocVersion.DocVersionConfig.Unit_Number);
//if (str.Contains("<U>"))
// str = str.Replace("<U>", MyDocVersion.DocVersionConfig.Unit_Number);
return ConvertToDisplayText(str,false);
}
}
public string DisplayText
{
get
@@ -1845,9 +1858,13 @@ namespace VEPROMS.CSLA.Library
//get { return ConvertToDisplayText(MyContent.Number); }
}
public static string ConvertToDisplayText(string txt)
{
return ConvertToDisplayText(txt, true);
}
public static string ConvertToDisplayText(string txt, bool stripRTF)
{
string retval = txt;
retval = StripRtfFormatting(retval);
if (stripRTF) retval = StripRtfFormatting(retval);
retval = StripLinks(retval);
retval = ReplaceSpecialCharacters(retval);
retval = retval.Replace("\u2011", "-");