Initialize static variable containing the BASEall.xml format information

Added a static variable for the BASEall.xml format information
Added parameters to allow a transition search in selected step elements. (B2015-055)
Make symbol list available without first selecting a procedure set, fixed searching for symbols bug (B2014-057), fix for transition search by type (B2015-055),
This commit is contained in:
2015-08-20 18:59:16 +00:00
parent d5b30b523f
commit 6f68a01ca9
4 changed files with 44 additions and 10 deletions

View File

@@ -144,6 +144,7 @@ namespace Volian.Controls.Library
gpSrchAnnoText.Enabled = true;
cmbResultsStyle.Enabled = false;
tabSearchTypes.SelectedTabChanged += new TabStrip.SelectedTabChangedEventHandler(tabSearchTypes_SelectedTabChanged);
SetupContextMenu(); // so that the symbol list is available without selecting a procedure set or procedure
}
void tabSearchTypes_SelectedTabChanged(object sender, TabStripTabChangedEventArgs e)
@@ -1140,17 +1141,20 @@ namespace Volian.Controls.Library
private string ConvertSpecialChars(string str)
{
string rtnVal = str;
if (_MyDocVersion != null)
{
rtnVal = rtnVal.Replace("\u00A0", @"\u160?"); //convert \u00A0 to a hard space (\u00A0 shows as a blank in the search text field)
rtnVal = rtnVal.Replace("\n", "");
FormatData fmtdata = _MyDocVersion.ActiveFormat.PlantFormat.FormatData;
// Bug fix B2014-057
// if we are searching for a symbol character in all procedure sets MyDocVersion is null
// when MyDocVersion is null, get the symbol list directly from the PROMS base format (BaseAll.xml)
FormatData fmtdata = (_MyDocVersion != null) ? _MyDocVersion.ActiveFormat.PlantFormat.FormatData : FormatInfo.PROMSBaseFormat.FormatData;
if (fmtdata != null && fmtdata.SymbolList != null)
{
SymbolList sl = fmtdata.SymbolList;
if (sl != null)
{
foreach (Symbol sym in sl)
{
string rplace = string.Format(sym.Unicode < 256 ? @"\'{0:X2}" : @"\u{0}", sym.Unicode);
string rplace = string.Format(sym.Unicode < 256 ? @"\'{0:X2}" : @"\u{0}?", sym.Unicode); // bug fix B2014-057 we were not including the ? in the replace
rtnVal = rtnVal.Replace(((char)sym.Unicode).ToString(), rplace);
}
}
@@ -1306,7 +1310,8 @@ namespace Volian.Controls.Library
sep = ",";
}
}
SearchResults = ItemInfoList.GetListFromTransitionSearch(docVersionList, cbxTranFormat.SelectedIndex - 1, cbxTranCategory.SelectedItem.ToString() == "All" ? "" : cbxTranCategory.SelectedItem.ToString());
// added TypeSearchList for bug fix B2015-055
SearchResults = ItemInfoList.GetListFromTransitionSearch(docVersionList, cbxTranFormat.SelectedIndex - 1, cbxTranCategory.SelectedItem.ToString() == "All" ? "" : cbxTranCategory.SelectedItem.ToString(), TypeSearchList);
cmbResultsStyleIndex = 3; // display step text in results
}
AddMessageForEmptyAnnotations();
@@ -1660,9 +1665,13 @@ namespace Volian.Controls.Library
private void SetupContextMenu()
{
galSymbols.SubItems.Clear();
if (_MyDocVersion != null)
// Bug fix B2014-057
// if we are searching for a symbol character in all procedure sets MyDocVersion is null
// when MyDocVersion is null, get the symbol list directly from the PROMS base format (BaseAll.xml)
// this will populate the context menu of the Search text entry field so that a symbol can be selected without first selecting a procedure set
FormatData fmtdata = (_MyDocVersion != null) ? _MyDocVersion.ActiveFormat.PlantFormat.FormatData : FormatInfo.PROMSBaseFormat.FormatData;
if (fmtdata != null && fmtdata.SymbolList != null)
{
FormatData fmtdata = _MyDocVersion.ActiveFormat.PlantFormat.FormatData;
SymbolList sl = fmtdata.SymbolList;
if (sl == null || sl.Count <= 0)
{