Beispiel #1
0
            private IDictionary GetResourceCache(string cultureName)
            {
                object cultureNeutralKey;

                if (cultureName == null)
                {
                    cultureNeutralKey = SqlResourceProviderFactory.SqlResourceProvider.CultureNeutralKey;
                }
                else
                {
                    cultureNeutralKey = cultureName;
                }
                if (this._resourceCache == null)
                {
                    this._resourceCache = new ListDictionary();
                }
                IDictionary item = this._resourceCache[cultureNeutralKey] as IDictionary;

                if (item == null)
                {
                    item = SqlResourceHelper.GetResources(this._virtualPath, this._className, cultureName, null);
                    this._resourceCache[cultureNeutralKey] = item;
                }
                return(item);
            }
Beispiel #2
0
        public void Generate()
        {
            string vPath = GetVirtualPath(_provider);
            //scrittua sul db
            var cache = Resource;

            foreach (object k in cache.Keys)
            {
                SqlResourceHelper.AddResource(vPath, string.Empty, k.ToString(), cache[k].ToString(), DefaultDesignCulture(), _provider);
            }
        }
Beispiel #3
0
        private IDictionary GetResourceCache(string cultureName)
        {
            string cultureNeutralKey = cultureName == null?DefaultDesignCulture() : cultureName;

            IDictionary item = ResourceCache[cultureNeutralKey] as IDictionary;

            if (item == null)
            {
                item = SqlResourceHelper.GetResources(GetVirtualPath(_provider), null, cultureNeutralKey, _provider);
                ResourceCache[cultureNeutralKey] = item;
            }
            return(item);
        }