public bool TryAddChain(IChainWrapper chain) { string uid = chain.GetUid(); if (chains.ContainsKey(uid)) { return(false); } chains.Add(uid, chain); return(true); }
public bool TryInit(GenerationEnvironment env, IChainWrapper chain) => env.DoScoped(this, () => InitWithChain(env, chain));
private bool InitWithChain(GenerationEnvironment env, IChainWrapper chain) { this.ReferencedChain = chain; AdapterBody = GetAdapterBody(env); return(!(AdapterBody is null)); }
public static string GetPrefix(this IChainWrapper wrapper) => wrapper.ContributionType.GetPrefix();
public static bool IsGlobal(this IChainWrapper wrapper) => wrapper.ContributionType == ChainContributionType.Global;
public static bool IsMore(this IChainWrapper wrapper) => wrapper.ContributionType == ChainContributionType.More;
public static string GetFullyQualifiedName(this IChainWrapper wrapper) => $"{wrapper.Parent.GetFullyQualifiedName()}.{wrapper.Name}";
public static string GetUid(this IChainWrapper wrapper) => $"{wrapper.GetPrefix()}{wrapper.Parent.Name}.{wrapper.Name}";