コード例 #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());
        }
コード例 #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());
        }
コード例 #3
0
 public PropertyTranslation(XElement data)
 {
     TranslationManager.InitProperties(this, data);
 }
コード例 #4
0
        public static NeedsClassTagTranslation Get(string typeStr)
        {
            var match = TranslationManager.MatchString(typeStr);

            return(TranslationManager.NeedsClassTags.SingleOrDefault(o => o.Match == match));
        }
コード例 #5
0
 public NeedsClassTagTranslation(XElement data)
 {
     TranslationManager.InitProperties(this, data);
 }
コード例 #6
0
        public static ElementAccessTranslation Get(string typeStr)
        {
            var match = TranslationManager.MatchString(typeStr);

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