Exemplo n.º 1
0
        public bool TryAddChain(IChainWrapper chain)
        {
            string uid = chain.GetUid();

            if (chains.ContainsKey(uid))
            {
                return(false);
            }

            chains.Add(uid, chain);
            return(true);
        }
Exemplo n.º 2
0
 public bool TryInit(GenerationEnvironment env, IChainWrapper chain)
 => env.DoScoped(this, () => InitWithChain(env, chain));
Exemplo n.º 3
0
 private bool InitWithChain(GenerationEnvironment env, IChainWrapper chain)
 {
     this.ReferencedChain = chain;
     AdapterBody          = GetAdapterBody(env);
     return(!(AdapterBody is null));
 }
Exemplo n.º 4
0
 public static string GetPrefix(this IChainWrapper wrapper) => wrapper.ContributionType.GetPrefix();
Exemplo n.º 5
0
 public static bool IsGlobal(this IChainWrapper wrapper)
 => wrapper.ContributionType == ChainContributionType.Global;
Exemplo n.º 6
0
 public static bool IsMore(this IChainWrapper wrapper)
 => wrapper.ContributionType == ChainContributionType.More;
Exemplo n.º 7
0
 public static string GetFullyQualifiedName(this IChainWrapper wrapper)
 => $"{wrapper.Parent.GetFullyQualifiedName()}.{wrapper.Name}";
Exemplo n.º 8
0
 public static string GetUid(this IChainWrapper wrapper)
 => $"{wrapper.GetPrefix()}{wrapper.Parent.Name}.{wrapper.Name}";