Databinding modifiers - Redesigned API to leverage generics

Databinding modifiers - Updated default modifiers to use new API
This commit is contained in:
SpoinkyNL committed 2020-10-20 19:00:41 +02:00
1 parent 2bb663db15
commit fd9f3afef5
50 files changed
+487 -407

No files matched your search

@@ -12,7 +12,7 @@ namespace Artemis.Core.Services
RegisterBuiltInModifiers();
}
public DataBindingModifierTypeRegistration RegisterModifierType(PluginInfo pluginInfo, DataBindingModifierType dataBindingModifierType)
public DataBindingModifierTypeRegistration RegisterModifierType(PluginInfo pluginInfo, BaseDataBindingModifierType dataBindingModifierType)
{
if (pluginInfo == null)
throw new ArgumentNullException(nameof(pluginInfo));
@@ -30,12 +30,12 @@ namespace Artemis.Core.Services
DataBindingModifierTypeStore.Remove(registration);
}
public List<DataBindingModifierType> GetCompatibleModifierTypes(Type type)
public List<BaseDataBindingModifierType> GetCompatibleModifierTypes(Type type, ModifierTypePart part)
{
return DataBindingModifierTypeStore.GetForType(type).Select(r => r.DataBindingModifierType).ToList();
return DataBindingModifierTypeStore.GetForType(type, part).Select(r => r.DataBindingModifierType).ToList();
}
public DataBindingModifierType GetModifierType(Guid modifierTypePluginGuid, string modifierType)
public BaseDataBindingModifierType GetModifierType(Guid modifierTypePluginGuid, string modifierType)
{
return DataBindingModifierTypeStore.Get(modifierTypePluginGuid, modifierType)?.DataBindingModifierType;
}
@@ -14,7 +14,7 @@ namespace Artemis.Core.Services
/// </summary>
/// <param name="pluginInfo">The PluginInfo of the plugin this modifier type belongs to</param>
/// <param name="dataBindingModifierType">The modifier type to register</param>
DataBindingModifierTypeRegistration RegisterModifierType([NotNull] PluginInfo pluginInfo, [NotNull] DataBindingModifierType dataBindingModifierType);
DataBindingModifierTypeRegistration RegisterModifierType([NotNull] PluginInfo pluginInfo, [NotNull] BaseDataBindingModifierType dataBindingModifierType);
/// <summary>
/// Removes a modifier type so it is no longer available for use in data bindings
@@ -25,7 +25,7 @@ namespace Artemis.Core.Services
/// <summary>
/// Returns all the data binding modifier types compatible with the provided type
/// </summary>
List<DataBindingModifierType> GetCompatibleModifierTypes(Type type);
List<BaseDataBindingModifierType> GetCompatibleModifierTypes(Type type, ModifierTypePart part);
/// <summary>
/// Gets a modifier type by its plugin GUID and type name
@@ -33,6 +33,6 @@ namespace Artemis.Core.Services
/// <param name="modifierTypePluginGuid">The modifier type's plugin GUID</param>
/// <param name="modifierType">The type name of the modifier type</param>
/// <returns></returns>
DataBindingModifierType GetModifierType(Guid modifierTypePluginGuid, string modifierType);
BaseDataBindingModifierType GetModifierType(Guid modifierTypePluginGuid, string modifierType);
}
}