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()); }
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 PropertyTranslation(XElement data) { TranslationManager.InitProperties(this, data); }
public static NeedsClassTagTranslation Get(string typeStr) { var match = TranslationManager.MatchString(typeStr); return(TranslationManager.NeedsClassTags.SingleOrDefault(o => o.Match == match)); }
public NeedsClassTagTranslation(XElement data) { TranslationManager.InitProperties(this, data); }
public static ElementAccessTranslation Get(string typeStr) { var match = TranslationManager.MatchString(typeStr); return(TranslationManager.ElementAccesses.SingleOrDefault(o => o.Match == match)); }