mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:56:31 +00:00
huge queue refactoring:
3 queues -> 1 queue send delete validate updates
This commit is contained in:
@@ -30,7 +30,8 @@
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="32"></RowDefinition>
|
||||
<RowDefinition Height="18"></RowDefinition>
|
||||
<RowDefinition Height="14"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Image
|
||||
Grid.Row="0"
|
||||
@@ -42,6 +43,11 @@
|
||||
Grid.Row="1"
|
||||
Foreground="LightGray"
|
||||
Text="{Binding ImageName}" />
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Right"
|
||||
Foreground="Gray"
|
||||
Text="{Binding CreatedEmail}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -273,10 +273,9 @@ public partial class DatasetExplorer
|
||||
if (result != MessageBoxResult.Yes)
|
||||
return;
|
||||
|
||||
var annotations = ThumbnailsView.SelectedItems.Cast<AnnotationThumbnail>().Select(x => x.Annotation)
|
||||
.ToList();
|
||||
var annotationNames = ThumbnailsView.SelectedItems.Cast<AnnotationThumbnail>().Select(x => x.Annotation.Name).ToList();
|
||||
|
||||
await _mediator.Publish(new AnnotationsDeletedEvent(annotations));
|
||||
await _mediator.Publish(new AnnotationsDeletedEvent(annotationNames));
|
||||
ThumbnailsView.SelectedIndex = Math.Min(SelectedAnnotations.Count, tempSelected);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public class DatasetExplorerEventHandler(
|
||||
var annotations = datasetExplorer.ThumbnailsView.SelectedItems.Cast<AnnotationThumbnail>()
|
||||
.Select(x => x.Annotation)
|
||||
.ToList();
|
||||
await annotationService.ValidateAnnotations(annotations, cancellationToken);
|
||||
await annotationService.ValidateAnnotations(annotations.Select(x => x.Name).ToList(), token: cancellationToken);
|
||||
foreach (var ann in datasetExplorer.SelectedAnnotations.Where(x => annotations.Contains(x.Annotation)))
|
||||
{
|
||||
ann.Annotation.AnnotationStatus = AnnotationStatus.Validated;
|
||||
@@ -143,9 +143,8 @@ public class DatasetExplorerEventHandler(
|
||||
|
||||
public async Task Handle(AnnotationsDeletedEvent notification, CancellationToken cancellationToken)
|
||||
{
|
||||
var names = notification.Annotations.Select(x => x.Name).ToList();
|
||||
var annThumbs = datasetExplorer.SelectedAnnotationDict
|
||||
.Where(x => names.Contains(x.Key))
|
||||
.Where(x => notification.AnnotationNames.Contains(x.Key))
|
||||
.Select(x => x.Value)
|
||||
.ToList();
|
||||
foreach (var annThumb in annThumbs)
|
||||
|
||||
Reference in New Issue
Block a user