B2019-004: An annotation is not removed from Annotation search results when it is deleted in the editor

This commit is contained in:
Kathy Ruffing 2019-05-09 13:01:49 +00:00
parent 8a96b47e72
commit d7b97677d5
2 changed files with 31 additions and 21 deletions

View File

@ -279,14 +279,14 @@ namespace Volian.Controls.Library
{
//using (Annotation annotation = CurrentAnnotation.Get())
//{
// annotation.Delete();
_AnnotationSearch.LoadingList = true;
Annotation.DeleteAnnotation(CurrentAnnotation);
// annotation.Save();
_AnnotationSearch.LoadingList = false;
CurrentAnnotation = null;
UpdateAnnotationGrid();
//_AnnotationSearch.UpdateAnnotationSearchResults(); // update the search results
// annotation.Delete();
_AnnotationSearch.LoadingList = true;
Annotation.DeleteAnnotation(CurrentAnnotation);
// annotation.Save();
_AnnotationSearch.LoadingList = false;
CurrentAnnotation = null;
UpdateAnnotationGrid();
_AnnotationSearch.UpdateAnnotationSearchResults(); // B2019-004: update search results list when an annotation is removed.
//}
}

View File

@ -1056,19 +1056,29 @@ namespace Volian.Controls.Library
// }
// Console.WriteLine("{0} Populate", DateTime.Now);
//}
//public void UpdateAnnotationSearchResults()
//{
// //AnnotationTypeInfo ati = cbxAnnoTypes.SelectedValue as AnnotationTypeInfo;
// //_LoadingList = true;
// //lbSrchResults.DataSource = ati.AnnotationTypeAnnotations;
// //lbSrchResults.SelectedIndex = -1;
// //LastResultsMouseOverIndex = -1;
// //if (lbSrchResults.Items.Count > 0)
// // btnPrnSrchRslts.Enabled = true;
// //else
// // btnPrnSrchRslts.Enabled = false;
// //_LoadingList = false;
//}
public void UpdateAnnotationSearchResults()
{
// B2019-004: update search results list when an annotation is removed. (before bug fix, code method & code below was commented out)
string unitPrefix = "";
if (Mydocversion != null)
unitPrefix = Mydocversion.DocVersionConfig.Unit_ProcedureNumber;
if (unitPrefix.EndsWith("#"))
unitPrefix = unitPrefix.Replace("#", "");
SearchResults = ItemInfoList.GetListFromAnnotationSearch(DVISearchList, TypeSearchList, AnnotationSearchType, cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked, unitPrefix);
DisplayResults();
/*
AnnotationTypeInfo ati = cbxAnnoTypes.SelectedValue as AnnotationTypeInfo;
_LoadingList = true;
lbSrchResults.DataSource = ati.AnnotationTypeAnnotations;
lbSrchResults.SelectedIndex = -1;
LastResultsMouseOverIndex = -1;
if (lbSrchResults.Items.Count > 0)
btnPrnSrchRslts.Enabled = true;
else
btnPrnSrchRslts.Enabled = false;
_LoadingList = false;
* */
}
private void lbSrchResults_MouseMove(object sender, MouseEventArgs e)
{
int ResultsMouseOverIndex = lbSrchResults.IndexFromPoint(e.Location);