B2024-068_069_check_if_current_annotation_is_not_selected_before_removal_of_annotation

This commit is contained in:
Matthew Schill 2024-09-11 15:34:22 -04:00
parent 78416ef452
commit 8617ce4562

View File

@ -277,17 +277,27 @@ namespace Volian.Controls.Library
private void btnRemoveAnnotation_Click(object sender, EventArgs e)
{
//using (Annotation annotation = CurrentAnnotation.Get())
//{
// 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.
//}
// CSM B2024-068 / B2024-069 - check if current annotation is not selected before removal of annotation
if (CurrentAnnotation != null)
{
//using (Annotation annotation = CurrentAnnotation.Get())
//{
// 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.
//}
}
else
{
FlexibleMessageBox.Show("You Must Select an Annotation To Remove", "Annotation Not Selected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
}
private void btnSaveAnnotation_Click(object sender, EventArgs e)