internal FormatterExpression GetProfile(string profileName) { FormatterExpression expr = _formatterProfiles.GetOrAdd(profileName, name => new FormatterExpression(t => (IValueFormatter)_serviceCtor(t))); return(expr); }
public IFormatterExpression ForSourceType <TSource>() { var valueFormatter = new FormatterExpression(_formatterCtor); _typeSpecificFormatters[typeof(TSource)] = valueFormatter; return(valueFormatter); }
internal FormatterExpression GetProfile(string profileName) { FormatterExpression expr; if (!_formatterProfiles.TryGetValue(profileName, out expr)) { lock (_formatterProfiles) { if (!_formatterProfiles.TryGetValue(profileName, out expr)) { expr = new FormatterExpression(t => (IValueFormatter)_serviceCtor(t)); _formatterProfiles.Add(profileName, expr); } } } return(expr); }