add results pane

differentiate videos which already has annotations
This commit is contained in:
Oleksandr Bezdieniezhnykh
2024-07-20 13:50:10 +03:00
parent 288a34e992
commit 83e3532de2
11 changed files with 189 additions and 87 deletions
+13 -5
View File
@@ -313,7 +313,7 @@ public class CanvasEditor : Canvas
#endregion
public void RemoveAnnotations(IEnumerable<AnnotationControl> listToRemove)
private void RemoveAnnotations(IEnumerable<AnnotationControl> listToRemove)
{
foreach (var ann in listToRemove)
{
@@ -321,8 +321,15 @@ public class CanvasEditor : Canvas
CurrentAnns.Remove(ann);
}
}
public void RemoveAllAnns() => RemoveAnnotations(CurrentAnns);
public void RemoveSelectedAnns() => RemoveAnnotations(CurrentAnns.Where(x => x.IsSelected));
public void RemoveAllAnns()
{
foreach (var ann in CurrentAnns)
Children.Remove(ann);
CurrentAnns.Clear();
}
public void RemoveSelectedAnns() => RemoveAnnotations(CurrentAnns.Where(x => x.IsSelected).ToList());
private void ClearSelections()
{
@@ -331,7 +338,8 @@ public class CanvasEditor : Canvas
}
public void ClearExpiredAnnotations(TimeSpan time)
{
RemoveAnnotations(CurrentAnns.Where(x => time - x.Time > _viewThreshold));
{
var expiredAnns = CurrentAnns.Where(x => Math.Abs((time - x.Time).TotalMilliseconds) > _viewThreshold.TotalMilliseconds).ToList();
RemoveAnnotations(expiredAnns);
}
}