Started work on profiles

This commit is contained in:
Robert committed 2019-11-18 20:11:17 +01:00
1 parent 5921f8ab54
commit fd942dab25
28 files changed
+575 -375

No files matched your search

+13 -13
View File
@@ -11,9 +11,21 @@ namespace Artemis.Core.Models.Profile
{
public class Profile : IProfileElement
{
private Profile(PluginInfo pluginInfo)
internal Profile(PluginInfo pluginInfo, ProfileEntity profileEntity, IPluginService pluginService)
{
PluginInfo = pluginInfo;
Name = profileEntity.Name;
// Populate the profile starting at the root, the rest is populated recursively
Children = new List<IProfileElement> {Folder.FromFolderEntity(this, profileEntity.RootFolder, pluginService)};
}
internal Profile(PluginInfo pluginInfo, string name)
{
PluginInfo = pluginInfo;
Name = name;
Children = new List<IProfileElement>();
}
public PluginInfo PluginInfo { get; }
@@ -46,18 +58,6 @@ namespace Artemis.Core.Models.Profile
}
}
public static Profile FromProfileEntity(PluginInfo pluginInfo, ProfileEntity profileEntity, IPluginService pluginService)
{
var profile = new Profile(pluginInfo) {Name = profileEntity.Name};
lock (profile)
{
// Populate the profile starting at the root, the rest is populated recursively
profile.Children.Add(Folder.FromFolderEntity(profile, profileEntity.RootFolder, pluginService));
return profile;
}
}
public void Activate()
{
lock (this)