Data model paths - Added support for lists

Data model paths - Added deferred compilation to accessors
Data models - Fixed property name being empty sometimes
Plugins - Fixed disabling plugins that failed to load
This commit is contained in:
Robert committed 2020-10-05 19:52:22 +02:00
1 parent 3be217a33b
commit 3fcfe4ceec
10 files changed
+176 -96

No files matched your search

@@ -64,7 +64,8 @@ namespace Artemis.Core.DataModelExpansions
throw new ArgumentNullException(nameof(dynamicDataModel));
if (key == null)
throw new ArgumentNullException(nameof(key));
if (key.Contains('.'))
throw new ArtemisCoreException("The provided key contains an illegal character (.)");
if (_dynamicDataModels.ContainsKey(key))
{
throw new ArtemisCoreException($"Cannot add a dynamic data model with key '{key}' " +
@@ -87,7 +88,7 @@ namespace Artemis.Core.DataModelExpansions
dynamicDataModel.PluginInfo = PluginInfo;
dynamicDataModel.DataModelDescription = new DataModelPropertyAttribute
{
Name = name ?? key.Humanize(),
Name = string.IsNullOrWhiteSpace(name) ? key.Humanize() : name,
Description = description
};
_dynamicDataModels.Add(key, dynamicDataModel);
+6
View File
@@ -105,6 +105,12 @@ namespace Artemis.Core
InternalDisablePlugin();
OnPluginDisabled();
}
// A failed load is still enabled in plugin info (to avoid disabling it permanently after a fail)
// update even that when manually disabling
else if (!enable && !Enabled)
{
PluginInfo.Enabled = false;
}
}
internal virtual void InternalEnablePlugin()