-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
MergedCollectionConfig.cs
62 lines (53 loc) · 2.09 KB
/
MergedCollectionConfig.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright (c) Arlo Godfrey. All Rights Reserved.
// Licensed under the GNU Lesser General Public License, Version 3.0 with additional terms.
// See the LICENSE, LICENSE.LESSER and LICENSE.ADDITIONAL files in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
namespace StrixMusic.Sdk.AdapterModels;
/// <summary>
/// Provides configuration options for a <see cref="MergedCollectionMap{TCollection, TCoreCollection, TCollectionItem, TCoreCollectionItem}"/>.
/// </summary>
public class MergedCollectionConfig
{
private MergedCollectionSorting _mergedCollectionSorting;
private IReadOnlyList<string> _coreRanking = new List<string>();
/// <summary>
/// Creates a new instance of <see cref="MergedCollectionConfig"/>.
/// </summary>
public MergedCollectionConfig()
{
}
/// <summary>
/// Creates a new instance of <see cref="MergedCollectionConfig"/>.
/// </summary>
public MergedCollectionConfig(MergedCollectionSorting mergedCollectionSorting, IEnumerable<string> coreRanking)
{
_mergedCollectionSorting = mergedCollectionSorting;
_coreRanking = coreRanking.ToList();
}
/// <summary>
/// The user's preference for how items in a collection from multiple sources are sorted.
/// </summary>
public MergedCollectionSorting MergedCollectionSorting
{
get => _mergedCollectionSorting;
set => _mergedCollectionSorting = value;
}
/// <summary>
/// The user's preferred ranking for each core, stored as the core's instance ID. Highest ranking first.
/// </summary>
public IReadOnlyList<string> CoreRanking
{
get => _coreRanking;
set => _coreRanking = value;
}
/// <summary>
/// Raised when <see cref="CoreRanking"/> is changed.
/// </summary>
public event EventHandler<IReadOnlyList<string>>? CoreRankingChanged;
/// <summary>
/// Raised when <see cref="MergedCollectionSorting"/> is changed.
/// </summary>
public event EventHandler<MergedCollectionSorting>? MergedCollectionSortingChanged;
}