mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:26:30 +00:00
big refactoring. get rid of static properties and coupled architecture. prepare system for integration tests
This commit is contained in:
@@ -13,7 +13,9 @@ public class DatasetExplorerEventHandler(
|
||||
ILogger<DatasetExplorerEventHandler> logger,
|
||||
DatasetExplorer datasetExplorer,
|
||||
IAnnotationService annotationService,
|
||||
IAzaionApi azaionApi) :
|
||||
IAzaionApi azaionApi,
|
||||
IUICommandDispatcher uiDispatcher,
|
||||
IAnnotationPathResolver pathResolver) :
|
||||
INotificationHandler<KeyEvent>,
|
||||
INotificationHandler<DatasetExplorerControlEvent>,
|
||||
INotificationHandler<AnnotationCreatedEvent>,
|
||||
@@ -121,7 +123,7 @@ public class DatasetExplorerEventHandler(
|
||||
|
||||
public async Task Handle(AnnotationCreatedEvent notification, CancellationToken token)
|
||||
{
|
||||
await datasetExplorer.Dispatcher.Invoke(async () =>
|
||||
await uiDispatcher.ExecuteAsync(async () =>
|
||||
{
|
||||
var annotation = notification.Annotation;
|
||||
var selectedClass = datasetExplorer.LvClasses.CurrentClassNumber;
|
||||
@@ -132,7 +134,11 @@ public class DatasetExplorerEventHandler(
|
||||
|
||||
var index = 0;
|
||||
var currentUser = await azaionApi.GetCurrentUserAsync();
|
||||
var annThumb = new AnnotationThumbnail(annotation, currentUser.Role.IsValidator());
|
||||
var annThumb = new AnnotationThumbnail(
|
||||
annotation,
|
||||
currentUser.Role.IsValidator(),
|
||||
pathResolver.GetImagePath(annotation),
|
||||
pathResolver.GetThumbPath(annotation));
|
||||
if (datasetExplorer.SelectedAnnotationDict.ContainsKey(annThumb.Annotation.Name))
|
||||
{
|
||||
datasetExplorer.SelectedAnnotationDict.Remove(annThumb.Annotation.Name);
|
||||
@@ -153,7 +159,7 @@ public class DatasetExplorerEventHandler(
|
||||
{
|
||||
try
|
||||
{
|
||||
datasetExplorer.Dispatcher.Invoke(() =>
|
||||
uiDispatcher.Execute(() =>
|
||||
{
|
||||
var annThumbs = datasetExplorer.SelectedAnnotationDict
|
||||
.Where(x => notification.AnnotationNames.Contains(x.Key))
|
||||
|
||||
Reference in New Issue
Block a user