コード例 #1
0
        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);
         }
     }
 }
コード例 #3
0
 public ResourceKeyValues(string resourceKey, ResourceValue resourceValue)
     : this(resourceKey)
 {
     this.resourceValues.Add(resourceValue.Culture, resourceValue);
 }