Exemple #1
0
        public static TypeTranslation Get(string typeStr)
        {
            var match = TranslationManager.MatchString(typeStr);

            var matches = TranslationManager.Types.Where(o => o.Matches(typeStr, match)).ToList();

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

            return(matches.SingleOrDefault());
        }
        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());
        }