コード例 #1
0
        public void AddResource(string name, string value, string culture)
        {
            var res = Resources.FirstOrDefault(_ => _.CultureName == culture);

            if (res == null)
            {
                res = new XResource {
                    CultureName = culture
                };
                Resources.Add(res);
            }

            var item = res.Values.FirstOrDefault(_ => _.Name == name);

            if (item == null)
            {
                item = new XValue()
                {
                    Name = name
                };
                res.Values.Add(item);
            }

            item.Value = value;
        }
コード例 #2
0
        public void AddResource(string name, string value, string culture)
        {
            var res = Resources.FirstOrDefault(_ => _.CultureName == culture);

            if (res == null)
            {
                res = new XResource { CultureName = culture };
                Resources.Add(res);
            }

            var item = res.Values.FirstOrDefault(_ => _.Name == name);

            if (item == null)
            {
                item = new XValue() { Name = name };
                res.Values.Add(item);
            }

            item.Value = value;
        }