public void Add(string resourceKey, string value, CultureInfo culture)
        {
            if (string.IsNullOrWhiteSpace(resourceKey))
            {
                throw new ArgumentNullException("resourceKey");
            }

            if (culture == null)
            {
                throw new ArgumentNullException("culture");
            }

            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            ResourceValue rv = new ResourceValue(value, culture);

            this.Add(new ResourceKeyValues(resourceKey, rv));
        }
Пример #2
0
 void FillOutput(ref Dictionary<string, ResourceValue> output, Type t, string culture)
 {
     var r = new ResourceManager(t);
     var set = r.GetResourceSet(CultureInfo.CreateSpecificCulture(culture), true, true);
     foreach (DictionaryEntry s in set)
     {
         var key = t.Namespace + "." + s.Key.ToString();
         if (output.ContainsKey(key))
         {
             var res = output[key];
             res.SetValue(culture, s.Value.ToString());
         }
         else
         {
             var res = new ResourceValue();
             res.SetValue(culture, s.Value.ToString());
             output.Add(key, res);
         }
     }
 }
 public ResourceKeyValues(string resourceKey, ResourceValue resourceValue)
     : this(resourceKey)
 {
     this.resourceValues.Add(resourceValue.Culture, resourceValue);
 }