private bool TryGetLocalizedString(string key, out GetOrFormatLocalizedString value, out TStringDictionary localizedStringsForCurrentCulture) { localizedStringsForCurrentCulture = LocalizedStrings[culture]; if (localizedStringsForCurrentCulture.TryGetValue(key, out var localizedString)) { value = new GetOrFormatLocalizedString(localizedString, Format); return(true); } else { value = default; return(false); } }
GetOrFormatLocalizedString IReadOnlyDictionary <string, GetOrFormatLocalizedString> .this[string key] { get { if (TryGetLocalizedString(key, out var value, out var localizedStringsForCurrentCulture)) { return(value); } var notFoundResource = new LocalizedString(key, key, true, resource); localizedStringsForCurrentCulture.Add(key, notFoundResource); value = new GetOrFormatLocalizedString(notFoundResource, Format); return(value); } }
bool IReadOnlyDictionary <string, GetOrFormatLocalizedString> .TryGetValue(string key, out GetOrFormatLocalizedString value) { return(TryGetLocalizedString(key, out value, out var localizedStringsForCurrentCulture)); }