Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
 bool IReadOnlyDictionary <string, GetOrFormatLocalizedString> .TryGetValue(string key, out GetOrFormatLocalizedString value)
 {
     return(TryGetLocalizedString(key, out value, out var localizedStringsForCurrentCulture));
 }