Keep special characters for Enhanced Document Text
This commit is contained in:
parent
d42a05a1f4
commit
d46ee4e39c
@ -2439,6 +2439,73 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return ConvertToDisplayText(str);
|
return ConvertToDisplayText(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static Dictionary<string, string> _SpecialCharacters = null;
|
||||||
|
static Dictionary<string, string> SpecialCharacters
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if(_SpecialCharacters==null){
|
||||||
|
_SpecialCharacters = new Dictionary<string, string>();
|
||||||
|
_SpecialCharacters.Add(@"\u916?", "{Delta}");
|
||||||
|
_SpecialCharacters.Add(@"\line", "{Hard Return1}");
|
||||||
|
_SpecialCharacters.Add("\r\n", "{Hard Return2}");
|
||||||
|
_SpecialCharacters.Add(@"\'b0", "{Degree1}");
|
||||||
|
_SpecialCharacters.Add(@"\'B0", "{Degree2}");
|
||||||
|
_SpecialCharacters.Add(@"\u9586?","{backslash}");
|
||||||
|
_SpecialCharacters.Add(@"\u8805?","{greater than or equal}");
|
||||||
|
_SpecialCharacters.Add(@"\u8804?","{less than or equal}");
|
||||||
|
_SpecialCharacters.Add(@"\'b1","{plus minus}");
|
||||||
|
_SpecialCharacters.Add(@"\u931?","{sigma}");
|
||||||
|
_SpecialCharacters.Add(@"\u947?","{gamma}");
|
||||||
|
_SpecialCharacters.Add(@"\'bd","{half}");
|
||||||
|
_SpecialCharacters.Add(@"\u9604?","{accum}");
|
||||||
|
_SpecialCharacters.Add(@"\u9679?","{bullet}");
|
||||||
|
_SpecialCharacters.Add(@"\u8776?","{approx eq}");
|
||||||
|
_SpecialCharacters.Add(@"\u8773?","{similar eq}");
|
||||||
|
_SpecialCharacters.Add(@"\'f7","{division}");
|
||||||
|
_SpecialCharacters.Add(@"\u8730?","{square root}");
|
||||||
|
_SpecialCharacters.Add(@"\u961?","{rho}");
|
||||||
|
_SpecialCharacters.Add(@"\u960?","{pi}");
|
||||||
|
_SpecialCharacters.Add(@"\u956?","{micro}");
|
||||||
|
_SpecialCharacters.Add(@"\u948?","{lower case delta}");
|
||||||
|
_SpecialCharacters.Add(@"\u963?","{lower case sigma}");
|
||||||
|
_SpecialCharacters.Add(@"\'bc","{quarter}");
|
||||||
|
_SpecialCharacters.Add(@"\'d8","{dist zero}");
|
||||||
|
_SpecialCharacters.Add(@"\u274?","{energy}");
|
||||||
|
_SpecialCharacters.Add(@"\'ec","{grave}");
|
||||||
|
_SpecialCharacters.Add(@"\u9474?","{bar}");
|
||||||
|
_SpecialCharacters.Add(@"\u949?","{epsilon}");
|
||||||
|
_SpecialCharacters.Add(@"\u952?","{theta}");
|
||||||
|
_SpecialCharacters.Add(@"\u8857?","{dot in oval}");
|
||||||
|
_SpecialCharacters.Add(@"\u964?","{tau}");
|
||||||
|
_SpecialCharacters.Add(@"\u9830?","{diamond}");
|
||||||
|
_SpecialCharacters.Add(@"\u8593?","{Up Arrow}");
|
||||||
|
_SpecialCharacters.Add(@"\u8595?","{Down Arrow}");
|
||||||
|
}
|
||||||
|
return _SpecialCharacters;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string DisplayTextKeepSpecialChars
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string str = MyContent.Text;
|
||||||
|
if (MyDocVersion != null)
|
||||||
|
{
|
||||||
|
str = Regex.Replace(str, @"\<[uU]\>", MyDocVersion.DocVersionConfig.Unit_Number);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_MyLog.WarnFormat("Disconnected Data - ItemID = {0}", ItemID);
|
||||||
|
}
|
||||||
|
foreach (string key in SpecialCharacters.Keys)
|
||||||
|
str = str.Replace(key, SpecialCharacters[key]);
|
||||||
|
string retval = ConvertToDisplayText(str);
|
||||||
|
foreach (string key in SpecialCharacters.Keys)
|
||||||
|
retval = retval.Replace(SpecialCharacters[key],key);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
}
|
||||||
public string DisplayNumber
|
public string DisplayNumber
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -6385,7 +6452,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (seds != null && seds.Count != 0)
|
if (seds != null && seds.Count != 0)
|
||||||
{
|
{
|
||||||
ItemInfo srcItem = ItemInfo.Get(seds[0].ItemID);
|
ItemInfo srcItem = ItemInfo.Get(seds[0].ItemID);
|
||||||
if (srcItem.DisplayText != ii.DisplayText)
|
if (srcItem.DisplayTextKeepSpecialChars != ii.DisplayTextKeepSpecialChars)
|
||||||
{
|
{
|
||||||
if (retiil == null) retiil = new ItemInfoList(ii);
|
if (retiil == null) retiil = new ItemInfoList(ii);
|
||||||
else retiil.AddItem(ii);
|
else retiil.AddItem(ii);
|
||||||
@ -6407,7 +6474,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
ItemInfo srcItem = ItemInfo.Get(seds[0].ItemID);
|
ItemInfo srcItem = ItemInfo.Get(seds[0].ItemID);
|
||||||
using (Item enhItem = Item.Get(ii.ItemID))
|
using (Item enhItem = Item.Get(ii.ItemID))
|
||||||
{
|
{
|
||||||
enhItem.MyContent.Text = srcItem.DisplayText;
|
enhItem.MyContent.Text = srcItem.DisplayTextKeepSpecialChars;
|
||||||
enhItem.Save();
|
enhItem.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -636,7 +636,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
ItemInfo ii = ItemInfo.Get(ed.ItemID);
|
ItemInfo ii = ItemInfo.Get(ed.ItemID);
|
||||||
DisplayText dt = new DisplayText(ii, ii.MyContent.Text, false);
|
DisplayText dt = new DisplayText(ii, ii.MyContent.Text, false);
|
||||||
string str = ItemInfo.Get(tmp.ContentItems[0].ItemID).DisplayText;
|
string str = ItemInfo.Get(tmp.ContentItems[0].ItemID).DisplayTextKeepSpecialChars;
|
||||||
dt.Save(str);
|
dt.Save(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -933,20 +933,21 @@ namespace Volian.Controls.Library
|
|||||||
SelectDisplayTabItem(pg);
|
SelectDisplayTabItem(pg);
|
||||||
|
|
||||||
// If this is an enhanced document, check for refresh of text items:
|
// If this is an enhanced document, check for refresh of text items:
|
||||||
if (myItemInfo.IsProcedure)
|
//if (myItemInfo.IsProcedure)
|
||||||
{
|
//{
|
||||||
// make the myiteminfo into a procedureinfo (depending on where this is called from, just
|
// make the myiteminfo into a procedureinfo (depending on where this is called from, just
|
||||||
// casting it crashed:
|
// casting it crashed:
|
||||||
ProcedureInfo pi = ProcedureInfo.Get(myItemInfo.ItemID);
|
ProcedureInfo pi = ProcedureInfo.Get(myItemInfo.MyProcedure.ItemID);
|
||||||
ItemInfoList iil = pi.FindEnhancedProcedureTextDifferences();
|
ItemInfoList iil = pi.FindEnhancedProcedureTextDifferences();
|
||||||
if (iil != null)
|
if (iil != null)
|
||||||
{
|
{
|
||||||
if (MessageBox.Show(this, "Text differences were found between this enhanced procedure and its source procedure. Do you want to refresh the text in this procedure?", "Confirm Text Refresh", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
if (MessageBox.Show(this, "Text differences were found between this enhanced procedure and its source procedure. Do you want to refresh the text in this procedure?", "Confirm Text Refresh", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
|
|
||||||
pi.EnhancedProcedureRefreshTextDifferences(iil);
|
pi.EnhancedProcedureRefreshTextDifferences(iil);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
pg.MyStepTabPanel.MyProcedureItemInfo = proc;
|
pg.MyStepTabPanel.MyProcedureItemInfo = proc;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user