Beispiel #1
0
    public bool TranslateElementName(string elementName, [MaybeNullWhen(false)] out Type t)
    {
        var ret = elementNameTypeDict.TryGetValue(elementName, out t !);

        if (!ret)
        {
            var regis = LoquiRegistration.GetRegisterByFullName(elementName);
            if (regis != null)
            {
                t = elementNameTypeDict.GetOrAdd(elementName, () => regis.ClassType) !;
                return(t != null);
            }
            else
            {
                elementNameTypeDict[elementName] = null;
            }
        }
        return(ret && t != null);
    }