mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Datamodel - Prepping for some API expansions
This commit is contained in:
parent
225b9752a8
commit
222fddd749
@ -1,10 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Artemis.Core.Modules;
|
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Module = Artemis.Core.Modules.Module;
|
using Module = Artemis.Core.Modules.Module;
|
||||||
@ -16,6 +15,7 @@ namespace Artemis.Core.DataModelExpansions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class DataModel
|
public abstract class DataModel
|
||||||
{
|
{
|
||||||
|
private readonly List<DataModelPath> _activePaths = new();
|
||||||
private readonly Dictionary<string, DynamicChild> _dynamicChildren = new();
|
private readonly Dictionary<string, DynamicChild> _dynamicChildren = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -54,6 +54,11 @@ namespace Artemis.Core.DataModelExpansions
|
|||||||
[DataModelIgnore]
|
[DataModelIgnore]
|
||||||
public ReadOnlyDictionary<string, DynamicChild> DynamicChildren => new(_dynamicChildren);
|
public ReadOnlyDictionary<string, DynamicChild> DynamicChildren => new(_dynamicChildren);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a read-only list of <see cref="DataModelPath" />s targeting this data model
|
||||||
|
/// </summary>
|
||||||
|
public ReadOnlyCollection<DataModelPath> ActivePaths => _activePaths.AsReadOnly();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a read-only collection of all properties in this datamodel that are to be ignored
|
/// Returns a read-only collection of all properties in this datamodel that are to be ignored
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -277,5 +282,20 @@ namespace Artemis.Core.DataModelExpansions
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Paths
|
||||||
|
|
||||||
|
internal void AddDataModelPath(DataModelPath path)
|
||||||
|
{
|
||||||
|
if (!_activePaths.Contains(path))
|
||||||
|
_activePaths.Add(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void RemoveDataModelPath(DataModelPath path)
|
||||||
|
{
|
||||||
|
_activePaths.Remove(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user