mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 13:06:31 +00:00
sort thumbnails by date in DatasetExplorer
This commit is contained in:
@@ -266,7 +266,16 @@ public partial class MainWindow
|
||||
if (existingResult != null)
|
||||
_formState.AnnotationResults.Remove(existingResult);
|
||||
|
||||
_formState.AnnotationResults.Add(new AnnotationResult(timeValue, fName, annotations, _config));
|
||||
var dict = _formState.AnnotationResults
|
||||
.Select((x,i) => new { x.Time, Index = i })
|
||||
.ToDictionary(x => x.Time, x => x.Index);
|
||||
|
||||
var index = dict.Where(x => x.Key < timeValue)
|
||||
.OrderBy(x => x.Key - timeValue)
|
||||
.Select(x => x.Value + 1)
|
||||
.FirstOrDefault();
|
||||
|
||||
_formState.AnnotationResults.Insert(index, new AnnotationResult(timeValue, fName, annotations, _config));
|
||||
await File.WriteAllTextAsync($"{_config.ResultsDirectory}/{fName}.json", JsonConvert.SerializeObject(_formState.AnnotationResults));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user