29 lines
808 B
C#
29 lines
808 B
C#
using System.Collections.Concurrent;
|
|
using JNPF.Common.Extension;
|
|
|
|
namespace JNPF.VisualDev
|
|
{
|
|
public class OverideVisualDevManager
|
|
{
|
|
private static ConcurrentDictionary<string, Type> actions = new ConcurrentDictionary<string, Type>();
|
|
public OverideVisualDevManager()
|
|
{
|
|
}
|
|
|
|
public static IOverideVisualDevService? GetOrDefault(string modelId)
|
|
{
|
|
var tp = actions.GetOrDefault(modelId);
|
|
if (tp != null) { return (IOverideVisualDevService)App.GetService(tp); }
|
|
return null;
|
|
}
|
|
|
|
public static void Add(string modelId, Type overideVisualDev)
|
|
{
|
|
if (!actions.ContainsKey(modelId))
|
|
{
|
|
actions.TryAdd(modelId, overideVisualDev);
|
|
}
|
|
}
|
|
}
|
|
}
|