C2019-001: Provide option to search only in RNO steps

This commit is contained in:
Kathy Ruffing 2021-05-12 14:48:38 +00:00
parent 2ba654b622
commit f3daf3b6eb
2 changed files with 292 additions and 193 deletions

File diff suppressed because it is too large Load Diff

View File

@ -194,6 +194,7 @@ namespace Volian.Controls.Library
xpStepTypes.Enabled = true;
lbSrchResults.Visible = true;
lbSrchResultsIncTrans.Visible = false;
cbxRnoOnly.Visible = true;
if (e.NewTab == tabIncTrans) // C2020-033: Incoming transitions
{
xpSetToSearch.Enabled = false;
@ -203,6 +204,7 @@ namespace Volian.Controls.Library
lbSrchResultsIncTrans.CheckBoxesVisible = true;
lbSrchResultsIncTrans.AutoScroll = true;
btnSearch.Enabled = false; // C2021 - 002: disable search button - no functionality for Incoming Transitions
cbxRnoOnly.Visible = false;
}
else if (e.NewTab == tabROSearch)
{
@ -1561,6 +1563,8 @@ namespace Volian.Controls.Library
cmbResultsStyleIndex = 3; // display step text in results
//}
}
// C2019-001: Search in RNO steps only
if (cbxRnoOnly.Checked) GetInRNOResults();
}
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) // Annotation Search
{
@ -1584,6 +1588,8 @@ namespace Volian.Controls.Library
SearchResults = ItemInfoList.GetListFromAnnotationSearch(DVISearchList, TypeSearchList, AnnotationSearchType, cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked, unitPrefix);
//UpdateAnnotationSearchResults();
cmbResultsStyleIndex = 2; // display annotation text in results
// C2019-001: Search in RNO steps only
if (cbxRnoOnlyAnnot.Checked) GetInRNOResults();
}
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[2]) // RO Search
{
@ -1601,6 +1607,8 @@ namespace Volian.Controls.Library
SearchResults = ItemInfoList.GetListFromROSearch(DVISearchList, TypeSearchList, ROSearchList, unitPrefix);
cmbResultsStyleIndex = 3; // display step text in results
}
// C2019-001: Search in RNO steps only
if (cbxRnoOnlyRO.Checked) GetInRNOResults();
}
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[3]) //Transition Search
{
@ -1623,6 +1631,8 @@ namespace Volian.Controls.Library
// 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
// C2019-001: Search in RNO steps only
if (cbxRnoOnlyTrans.Checked) GetInRNOResults();
}
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4])
{
@ -1669,7 +1679,28 @@ namespace Volian.Controls.Library
//if (VlnSettings.DebugMode)
// MessageBox.Show(string.Format("{0} Milliseconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds));
}
// C2019-001: Search in RNO steps only
private void GetInRNOResults()
{
bool first = true;
ItemInfoList iil = null;
foreach (ItemInfo ii in SearchResults)
{
if (ii.SearchPath.Contains(".RNO."))
{
if (first)
{
iil = new ItemInfoList(ii);
first = false;
}
else
{
iil.AddItem(ii);
}
}
}
SearchResults = iil;
}
private void AddMessageForEmptyAnnotations()
{
bool hasAnnot = false;