mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-12 10:23:08 +00:00
24 lines
712 B
C#
24 lines
712 B
C#
namespace Core
|
|
{
|
|
public class CoreInterface
|
|
{
|
|
private static readonly Dictionary<CoreInterface, EntryPoint> coreAssociations = new Dictionary<CoreInterface, EntryPoint>();
|
|
|
|
public T GetPlugin<T>() where T : IProjectPlugin
|
|
{
|
|
return coreAssociations[this].GetPlugin<T>();
|
|
}
|
|
|
|
internal static void Associate(CoreInterface coreInterface, EntryPoint entryPoint)
|
|
{
|
|
coreAssociations.Add(coreInterface, entryPoint);
|
|
}
|
|
|
|
internal static void Desociate(EntryPoint entryPoint)
|
|
{
|
|
var key = coreAssociations.Single(p => p.Value == entryPoint).Key;
|
|
coreAssociations.Remove(key);
|
|
}
|
|
}
|
|
}
|