Exemplo n.º 1
0
        public static TypeTranslation Get(string typeStr, INamedTypeSymbol symbolOpt)
        {
            var match = TranslationManager.MatchString(typeStr);

            var matches = TranslationManager.Types.Where(o => o.Match == match && (o.MatchNonGenericTypesOnly == false || symbolOpt.IsGenericType() == false)).ToList();

            if (matches.Count > 1)
            {
                throw new Exception("Multiple matches for " + match);
            }

            return(matches.SingleOrDefault());
        }
Exemplo n.º 2
0
        public static PropertyTranslation Get(string typeStr, string memberName)
        {
            var sourceObj = TranslationManager.MatchString(typeStr);


            var matches = TranslationManager.Properties.Where(o => o.Match == memberName && o.SourceObject == sourceObj).ToList();

            if (matches.Count > 1)
            {
                throw new Exception("Multiple matches for " + sourceObj + " " + memberName);
            }

            return(matches.SingleOrDefault());
        }
        public static NeedsClassTagTranslation Get(string typeStr)
        {
            var match = TranslationManager.MatchString(typeStr);

            return(TranslationManager.NeedsClassTags.SingleOrDefault(o => o.Match == match));
        }
        public static ElementAccessTranslation Get(string typeStr)
        {
            var match = TranslationManager.MatchString(typeStr);

            return(TranslationManager.ElementAccesses.SingleOrDefault(o => o.Match == match));
        }